server: reject empty required strings in tool schemas - #87
Merged
Conversation
The new schema-boundary test fails on the pre-fix server surface: - tests/server.test.ts > rejects empty required string inputs at the schema boundary - expected true to be false for git_commit.message Co-Authored-By: Codex (enjoys making invalid input somebody else's problem) <noreply@openai.com>
Why: The MCP server already trims and rejects several empty string inputs downstream, but the schema layer still accepted them. Tightening the schema keeps validation consistent and rejects bad tool input before execution. Verification: - npm test -- tests/server.test.ts - npm test - npm run typecheck Co-Authored-By: Codex (still not accepting blank commit messages) <noreply@openai.com>
niamster
marked this pull request as ready for review
June 25, 2026 21:05
niamster
enabled auto-merge
June 25, 2026 21:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why:
The server surface already treated empty commit messages and other required string fields as invalid, but several tool schemas still accepted empty strings and deferred rejection to deeper execution paths. Tightening the schema boundary keeps validation consistent across the tool surface and makes invalid input fail before tool execution.
Impact:
This rejects empty values earlier for
git_commit.message,git_branch_create_and_switch.new_branch,git_branch_switch.branch,git_worktree_add.new_branch, andgh_pr_create_drafttitle/body. The expected positive effect is more consistent schema-first validation and clearer tool failures; the main risk is only that callers relying on previously permissive empty-string parsing will now receive immediate validation errors instead.Tests:
npm testnpm run typecheckCloses #50