Repository navigation
fix(tools): advertise json and any params without an object type, and name the invalid mcp argument - #9261
Conversation
… name the invalid mcp argument
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryThe PR lets
Changes since the previous review stop collecting every validation error and update the tests to expect one named failure. No new actionable issues were found. Reviews (2) · Last reviewed commit: "fix(mcp): report the first invalid argum..." · Reviewed by Greptile |
There was a problem hiding this comment.
All reported issues were addressed across 6 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
…error allErrors made Ajv collect every failure on untrusted input before the message kept three; validation stops at the first failure again and the message names it.
|
@greptile |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
jsonandanytool params are no longer advertised astype: "object". About 994 params were affected, many of them arrays:cbinsights_list_business_relationships.orgIdsis described as "e.g. [129410, 1034157]" yet typed as an object. The model saw a contradiction, and validators that honor the type rejected correct calls (Pi local dev's pi-ai did). These params now carry notype, which allows any JSON value; the description stays.McpClient.getNegotiatedVersion()returns the transport's negotiated protocol version. It returned the server's Implementation object, so logs and the test-connection response always showedundefined.Type of Change
Testing
params.test.ts: ajson/anyparam accepts both an array and an object under Ajv, for both the LLM and copilot schema surfaces. The legacy snapshot expectation changes deliberately.execute-tool.test.ts: names each invalid argument (fails before the fix), and accepts valid arguments.buildParameterSchemawas checked: OpenAI tools are sent non-strict, Anthropic, Bedrock and Gemini pass untyped properties through (MCP tools already do), and the worker treatsinput_schemaas opaque.bun run type-checkpasses. CI runs the rest.Checklist