Skip to content

fix: preserve tool input types and required fields - #151

Open
gaojude wants to merge 1 commit into
mainfrom
codex/fix-tool-schema
Open

fix: preserve tool input types and required fields#151
gaojude wants to merge 1 commit into
mainfrom
codex/fix-tool-schema

Conversation

@gaojude

@gaojude gaojude commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

tools/list currently describes nextjs_call.args as a string, drops numeric ports, and omits required fields. A schema-validating MCP client can reject the documented Server Action lookup before it reaches the tool.

Use the MCP SDK's existing Zod-to-JSON-Schema converter for the complete input object. This preserves records, unions, descriptions, and required fields, with input types taken before transforms. Adds a patch changeset.

Validation:

  • pnpm build, pnpm typecheck, and the complete pnpm exec vitest run: 42 tests passed.
  • Added nine schema contract cases comparing advertised validation with the runtime Zod schema.
  • Connected over stdio, captured a Server Action ID from a real Next.js 16.3.4 browser submission, validated the object arguments with AJV, and resolved the action to its source file.

Local validation used macOS arm64, Node.js 24.19.0, and pnpm 9.15.9. The uploaded GitHub-signed commit has the same Git tree as the tested checkout.

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.

1 participant