continue-custom/core/tools
Dallin Romney ff89a88299
fix: coerce MCP tool args to match schema string types (#11852)
* fix: coerce MCP tool args to match schema string types

When tool call arguments are parsed via JSON.parse(), string-typed
parameters containing valid JSON (e.g. file content for .json files)
get deeply parsed into objects. Built-in tools handle this via
getStringArg(), but MCP tools with dynamic schemas had no equivalent
fix, causing write_file and similar tools to receive objects instead
of strings.

Add coerceArgsToSchema() that checks the tool's inputSchema and
re-stringifies any values that should be strings before passing
args to the MCP client.

Fixes #8510

* fix: narrow coercion to only objects/arrays, not numbers/booleans

Only re-stringify values that are objects or arrays (the actual
deep-parsing issue). Numbers and booleans passed to a string-typed
parameter are left as-is so they surface as type errors rather than
being silently converted.
2026-03-25 16:39:01 -07:00
..
definitions feat: make create/read rule tools disabled by default (#10543) 2026-02-16 12:15:57 -08:00
implementations fix: restrict terminal childProcess.spawn to local-only environments (#10538) 2026-03-24 20:33:04 -07:00
policies prettier 2025-10-16 19:08:31 -07:00
systemMessageTools Fix system-message tools parser when tool call is non-terminal (#11092) 2026-03-24 11:56:43 -07:00
applyToolOverrides.ts feat: add tool prompt override support in .continuerc.json (#9314) 2026-02-02 21:55:21 -08:00
applyToolOverrides.vitest.ts feat: add tool prompt override support in .continuerc.json (#9314) 2026-02-02 21:55:21 -08:00
builtIn.ts add read skill tool 2025-12-30 12:51:16 +05:30
callTool.ts fix: coerce MCP tool args to match schema string types (#11852) 2026-03-25 16:39:01 -07:00
constants.ts feat: tool call args preprocessing (#7992) 2025-09-30 18:49:29 -07:00
index.ts read skill is a tool definition 2026-01-06 17:31:04 +05:30
mcpToolName.ts feat: limited MCP App support (#10132) 2026-02-05 19:07:44 -08:00
mcpToolName.vitest.ts fix: core type error 2025-09-24 17:41:46 -07:00
parseArgs.ts fix: coerce MCP tool args to match schema string types (#11852) 2026-03-25 16:39:01 -07:00
parseArgs.vitest.ts fix: coerce MCP tool args to match schema string types (#11852) 2026-03-25 16:39:01 -07:00
searchWebGating.vitest.ts fix test lints 2026-01-06 17:58:53 +05:30