Skip to content

fix: accept omitted optional prompt and tool arguments#2045

Open
raashish1601 wants to merge 1 commit into
modelcontextprotocol:v1.xfrom
raashish1601:codex/optional-arguments-prompts-tools
Open

fix: accept omitted optional prompt and tool arguments#2045
raashish1601 wants to merge 1 commit into
modelcontextprotocol:v1.xfrom
raashish1601:codex/optional-arguments-prompts-tools

Conversation

@raashish1601
Copy link
Copy Markdown

Summary

  • default omitted tool arguments to {} during input validation
  • default omitted prompt arguments to {} during argument validation
  • add regression tests for optional tool and prompt schemas called without arguments

Fixes #1869.

Validation

  • npm test -- test/server/mcp.test.ts
  • npm run typecheck
  • npx prettier --check src/server/mcp.ts test/server/mcp.test.ts .changeset/fix-optional-arguments-prompts-tools.md
  • git diff --check
  • npx tsc -p tsconfig.prod.json --pretty false
  • npx tsc -p tsconfig.cjs.json --pretty false

npm run build still fails on Windows before TypeScript starts because build:esm uses POSIX shell syntax (mkdir -p ... && ...). The direct ESM and CJS TypeScript build commands above both pass.

@raashish1601 raashish1601 requested a review from a team as a code owner May 11, 2026 15:18
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 11, 2026

🦋 Changeset detected

Latest commit: 505f10e

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 11, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@modelcontextprotocol/sdk@2045

commit: 505f10e

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