fix(gitea-mcp): accept string or integer for numeric params #315

Merged
lmiranda merged 1 commits from fix/mcp-integer-type-coercion into development 2026-01-29 03:20:10 +00:00
Owner

Summary

  • MCP library validates schema BEFORE call_tool handler runs
  • Our _coerce_types function never gets a chance to convert strings to integers
  • Changed all integer fields to accept both types: "type": ["integer", "string"]

Fields Updated

  • issue_number - 8 tools
  • milestone_id - 3 tools
  • pr_number - 6 tools
  • depends_on - 2 tools
  • milestone - 1 tool
  • limit - 1 tool
  • position - 1 tool (inline comments)

Fixes

Error: Input validation error: '312' is not of type 'integer'

Test Plan

  • Restart Claude session to reload MCP server
  • Run update_issue with string issue number
  • Verify no type validation errors
## Summary - MCP library validates schema BEFORE `call_tool` handler runs - Our `_coerce_types` function never gets a chance to convert strings to integers - Changed all integer fields to accept both types: `"type": ["integer", "string"]` ## Fields Updated - `issue_number` - 8 tools - `milestone_id` - 3 tools - `pr_number` - 6 tools - `depends_on` - 2 tools - `milestone` - 1 tool - `limit` - 1 tool - `position` - 1 tool (inline comments) ## Fixes Error: `Input validation error: '312' is not of type 'integer'` ## Test Plan - [ ] Restart Claude session to reload MCP server - [ ] Run `update_issue` with string issue number - [ ] Verify no type validation errors
lmiranda added the Type/Bug label 2026-01-29 03:17:37 +00:00
lmiranda added 1 commit 2026-01-29 03:17:38 +00:00
MCP library validates schema BEFORE call_tool handler runs, so
our _coerce_types function never gets a chance to convert strings.

Changed all integer fields to accept both types:
- issue_number, milestone_id, pr_number, depends_on, milestone, limit, position

This fixes: "Input validation error: '312' is not of type 'integer'"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
lmiranda merged commit 5f82f8ebbd into development 2026-01-29 03:20:10 +00:00
lmiranda deleted branch fix/mcp-integer-type-coercion 2026-01-29 03:20:10 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: personal-projects/leo-claude-mktplace#315