Skip to content

fix(mcp): coerce JSON string params to native types + skip utility tools for unsupported servers#3690

Open
ygd58 wants to merge 2 commits intoNousResearch:mainfrom
ygd58:fix/mcp-json-string-coercion
Open

fix(mcp): coerce JSON string params to native types + skip utility tools for unsupported servers#3690
ygd58 wants to merge 2 commits intoNousResearch:mainfrom
ygd58:fix/mcp-json-string-coercion

Conversation

@ygd58
Copy link
Copy Markdown
Contributor

@ygd58 ygd58 commented Mar 29, 2026

Fixes #3682

Fix 1: JSON string coercion

LLMs emit array/boolean/number params as JSON-encoded strings. Added _coerce_json_strings() that converts these to native types before call_tool().

Fix 2: gitmcp utility tool discovery

hasattr(server.session, method) always returns True even when transport returns "Method not found". Now checks server_info.capabilities before registering list_resources/list_prompts tools.

@ygd58
Copy link
Copy Markdown
Contributor Author

ygd58 commented Mar 29, 2026

The test failure is a pre-existing CI issue — a skill invocation test checks for a specific string that was reworded in a prior commit. Not related to this PR's changes to tools/mcp_tool.py.

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.

MCP tool parameter type coercion missing: JSON strings not parsed before call_tool

1 participant