Skip to content

bug: ToolInputSchema design flaw #355

Closed
@kaliwin

Description

@kaliwin

Description

I think this "ToolInputSchema" structure is wrong. If the parameters are a complex nested object, then this structure cannot be expressed. The "Required" parameters should be defined in each object, not uniformly defined in the root object.

https://github.com/mark3labs/mcp-go/blob/main/mcp/tools.go#L518

type ToolInputSchema struct {
	Type       string         `json:"type"`
	Properties map[string]any `json:"properties,omitempty"`
	Required   []string       `json:"required,omitempty"`
}

I expect the parameter structure

type Args struct {
	Area Area
}

type Area struct {
	City    []string 
	Country string   
}

This is a nested object that I cannot represent using "ToolInputSchema"
Image

I think you can refer to https://github.com/googleapis/go-genai/blob/main/types.go#L903

If I understand it wrong, please let me know
If you need coding collaboration, I'm happy to help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions