Skip to content

Conversation

@gilbrotheraway
Copy link

@gilbrotheraway gilbrotheraway commented Jan 19, 2026

Summary

This PR fixes two issues with the skill_mcp tool that caused failures when arguments were passed as objects or single-quoted strings (common with LLMs).

  1. Schema Fix: Updated arguments parameter schema in src/tools/skill-mcp/tools.ts to accept both string and Record<string, unknown>. This prevents Zod from coercing object inputs into [object Object], which caused JSON parsing failures.
  2. Parser Fix: Updated parseArguments function 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 caused JSON.parse to fail.

These changes ensure the skill_mcp tool 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.

  • Bug Fixes
    • Updated arguments schema to accept string or object, avoiding Zod coercion to "[object Object]".
    • parseArguments now removes outer single quotes before JSON.parse.

Written for commit 65a567e. Summary will update on new commits.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 19, 2026

All contributors have signed the CLA. Thank you! ✅
Posted by the CLA Assistant Lite bot.

@gilbrotheraway
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Jan 19, 2026
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@kdcokenny
Copy link
Collaborator

@gilbrotheraway appreciate the pr but please ensure that the typecheck passes.

Zod v4 requires both keyType and valueType arguments for z.record().
The previous commit only passed valueType, causing TypeScript error TS2554.
@gilbrotheraway
Copy link
Author

@gilbrotheraway appreciate the pr but please ensure that the typecheck passes.

done, the typecheck was not showing on the release version i am on, only on beta

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.

2 participants