| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Zero-parameter tools like get_me fail when clients omit the arguments
field entirely. Default empty/missing JSON payloads to {} before
unmarshaling.
Fixes github#2587
| Back | FazBrowse Home | New Git URL |
Problem
Zero-parameter MCP tools such as get_me fail when a client omits the arguments field entirely. Some MCP clients send no arguments payload for tools with an empty input schema, which is valid JSON-RPC but breaks server-side unmarshaling.
Root cause
NewServerToolWithContextHandler unmarshals req.Params.Arguments directly into the handler argument struct. When the field is missing or empty, json.Unmarshal receives nil/empty bytes and returns an error before the tool handler runs.
Fix
Default nil or empty Arguments payloads to {} before unmarshaling. This matches the MCP expectation that tools with no required parameters can be invoked without an explicit arguments object.
Testing
Fixes #2587