Skip to content

When register a tool with no input argument (no need to pass any args) The properties field is missing #224

@HChengH

Description

@HChengH

version using: v0.23.1

Error msg from openAI: ValidationException: The json schema definition at toolConfig.tools.1.toolSpec.inputSchema is invalid. Fix the following errors and try again: $.properties: null found, object expected

Image

Image

To reproduce simply add the following tool in ur local test mcp server

mcpServer.AddTool(
    mcp.NewTool(
	"user-name-tool",
	mcp.WithDescription("User name tool, you can get the name of the current user."),
    ),
    func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) {
	return &mcp.CallToolResult{
		Content: []mcp.Content{
			mcp.TextContent{
				Type: "text",
				Text: "user name is: " + "HChengH",
			},
		},
	}, nil
    },
)

First introduced #116

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