Skip to content

server: reject empty required strings in tool schemas - #87

Merged
niamster merged 2 commits into
mainfrom
dm/issue-50-schema-min1
Jun 25, 2026
Merged

server: reject empty required strings in tool schemas#87
niamster merged 2 commits into
mainfrom
dm/issue-50-schema-min1

Conversation

@niamster

Copy link
Copy Markdown
Owner

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, and gh_pr_create_draft title/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 test
  • npm run typecheck

Closes #50

niamster and others added 2 commits June 25, 2026 22:53
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
niamster marked this pull request as ready for review June 25, 2026 21:05
@niamster
niamster enabled auto-merge June 25, 2026 21:05
@niamster
niamster merged commit bcafed8 into main Jun 25, 2026
3 checks passed
@niamster
niamster deleted the dm/issue-50-schema-min1 branch June 25, 2026 21:05
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.

git_commit schema accepts an empty message

1 participant