You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Is the README example Tool registration method incorrect? #128
Describe the bug
Is the README example Tool registration method incorrect?
Using the example from the README, I get an error saying that the inputSchema is expected to be an object.
Example from the README:
Tool(
name:"weather",
description:"Get current weather for a location",
inputSchema:.object(["location":.string("City name or coordinates"),"units":.string("Units of measurement, e.g., metric, imperial")]))
When I try this format, I get the expected response:
Tool(
name:"weather",
description:"Get current weather for a location",
inputSchema:.object(["type":"object","properties":["a":["type":"number"],"b":["type":"number"]],"required":["a","b"]]))
To Reproduce
Steps to reproduce the behavior:
1.
Expected behavior
A clear and concise description of what you expected to happen.
Logs
If applicable, add logs to help explain your problem.
Additional context
Add any other context about the problem here.
Activity
richard-giantrobot commentedon Jun 5, 2025
I was getting the same error, thanks to your code snippet it started working. Thank you @Kila2, how did you figure it out?
Kila2 commentedon Jun 5, 2025
I found that the input mode for MCP servers to send messages to clients is "{}", but the MCP protocol requires a "type" field, that's all
ptliddle commentedon Jun 14, 2025
No, see #131 (comment) for more context. It currently isn't producing valid JSON Schema output.
samkudr commentedon Sep 9, 2025
Yes, it misses
inputSchema.typeproperty. If #161 would be approved, at least partially, it will fix the issue.