Skip to content

fix(core): cover optional spec schema properties#1798

Open
rechedev9 wants to merge 1 commit intomodelcontextprotocol:mainfrom
rechedev9:fix/spec-optional-schema-coverage-1298
Open

fix(core): cover optional spec schema properties#1798
rechedev9 wants to merge 1 commit intomodelcontextprotocol:mainfrom
rechedev9:fix/spec-optional-schema-coverage-1298

Conversation

@rechedev9
Copy link
Copy Markdown

Fixes #1298

Summary

  • add a recursive spec-vs-schema coverage test that fails when named optional spec properties are missing from SDK object schemas
  • fill the current gaps the new check exposes in core schemas (PromptArgument.title, PromptReference.title, tool $schema fields, and elicitation requestedSchema.$schema)
  • keep the existing mutual-assignability checks in place while extending coverage to the optional-property case that PR Add optional description field to Implementation schema #1295 slipped through

Verification

  • ../../node_modules/.bin/tsgo -p tsconfig.json --noEmit
  • ../../node_modules/.bin/eslint src/
  • ../../node_modules/.bin/prettier --ignore-path ../../.prettierignore --check .
  • corepack pnpm --filter @modelcontextprotocol/core test

@rechedev9 rechedev9 requested a review from a team as a code owner March 27, 2026 20:18
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 27, 2026

⚠️ No Changeset found

Latest commit: b3f33ba

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 27, 2026

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/client@1798

@modelcontextprotocol/server

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/server@1798

@modelcontextprotocol/express

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/express@1798

@modelcontextprotocol/hono

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/hono@1798

@modelcontextprotocol/node

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/node@1798

commit: b3f33ba

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.

Make spec type tests catch .optional() missing args too

1 participant