Skip to content

x/tools/internal/jsonrpc2_v2: BadRequest due to empty JSON-RPC params object being marshalled to null instead of omitted #74105

Open
@andrey-star

Description

@andrey-star

nil params produce a "params": null in the POST body leading to Bad Request on ListTools calls from internal/mcp. If the params are nil, they should be omitted from the final request.

Based in the JSON-RPC spec the params object is either an array, or an object matching the expected params of the endpoint: https://www.jsonrpc.org/specification#request_object

Reference to the marshalling code: https://github.com/golang/tools/blob/439ea2f0f815f46421aaecd85ffd0f75b0a303f9/internal/jsonrpc2_v2/messages.go#L101-L118

Metadata

Metadata

Assignees

Labels

ToolsThis label describes issues relating to any tools in the x/tools repository.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions