fix(skill-mcp): allow object args and strip quotes #908
+30
−20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes two issues with the
skill_mcptool that caused failures when arguments were passed as objects or single-quoted strings (common with LLMs).argumentsparameter schema insrc/tools/skill-mcp/tools.tsto accept bothstringandRecord<string, unknown>. This prevents Zod from coercing object inputs into[object Object], which caused JSON parsing failures.parseArgumentsfunction to strip outer single quotes from string inputs before parsing. This handles cases where LLMs wrap the JSON string in single quotes (e.g.,'{"key": "value"}'), which previously causedJSON.parseto fail.These changes ensure the
skill_mcptool robustly handles various argument formats generated by agents.Summary by cubic
Fixes skill_mcp argument handling to accept both JSON strings and objects, and strips outer single quotes before parsing to prevent failures. This makes LLM-generated calls more reliable and prevents JSON parsing and coercion errors.
Written for commit 65a567e. Summary will update on new commits.