Skip to content

Update development tools and dependencies#81

Merged
djthorpe merged 1 commit into
mainfrom
djt/0611/tools
Jun 11, 2026
Merged

Update development tools and dependencies#81
djthorpe merged 1 commit into
mainfrom
djt/0611/tools

Conversation

@djthorpe

Copy link
Copy Markdown
Member

This pull request improves the handling of tools with a nil input schema in the server code, ensuring they are accepted and default to an empty object schema. It also adds a test to verify this behavior.

Input schema handling improvements:

  • Updated sdkToolFromTool in mcp/server/tool.go to default any nil input schema to an empty object schema using jsonschema.MustFor[struct{}](), ensuring all tools have a valid input schema.
  • Added the jsonschema import to support the new defaulting behavior.

Testing enhancements:

  • Added a new test tool, nilInputSchemaTool, and a corresponding test case, TestAddToolsNilInputSchemaDefaultsToEmptyObject, in mcp/server/tool_test.go to verify that tools with a nil input schema are accepted without error.
  • Added the missing llm import in the test file to support the new test tool implementation.

Copilot AI review requested due to automatic review settings June 11, 2026 13:20
@djthorpe djthorpe self-assigned this Jun 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the MCP server’s tool conversion to handle nil tool input schemas by defaulting them to an empty-object JSON schema, and adds a regression test around that behavior.

Changes:

  • Default llm.Tool.InputSchema() from nil to jsonschema.MustFor[struct{}]() during SDK tool conversion.
  • Add a new test tool and test case intended to verify nil input schema handling.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
mcp/server/tool.go Defaults nil tool input schemas to an empty-object JSON schema before marshalling into the SDK Tool.
mcp/server/tool_test.go Adds a test tool with nil InputSchema and a test case for server tool registration behavior.

Comment thread mcp/server/tool.go
Comment thread mcp/server/tool_test.go
@djthorpe djthorpe merged commit 15ed00f into main Jun 11, 2026
1 check passed
@djthorpe djthorpe deleted the djt/0611/tools branch June 11, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants