Skip to content

Conversation

@bgaidioz
Copy link
Contributor

Description

Fixes integer parameter conversion in MCP server where JSON float values (like 0.0) were not being converted to integers before passing to Python functions, even when tool schema specified "type": "integer".

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update
  • 🔧 Refactoring (no functional changes, no api changes)
  • ⚡ Performance improvement
  • 🧪 Test improvement
  • 🔒 Security fix

Testing

  • Tests pass locally with uv run pytest
  • Linting passes with uv run ruff check . (for production code)
  • Code formatting passes with uv run black --check . (for production code)
  • Type checking passes with uv run mypy . (for production code)
  • Added tests for new functionality (if applicable)
  • Updated documentation (if applicable)

Security Considerations

  • This change does not introduce security vulnerabilities
  • Sensitive data handling reviewed (if applicable)
  • Policy enforcement implications considered (if applicable)

Breaking Changes

If this is a breaking change, describe what users need to do to migrate:

N/A - This is a bug fix that improves existing behavior without breaking changes.

Additional Notes

The MCP server had an unused _convert_param_type method that correctly handled type conversion. The fix applies this conversion before passing parameters to the SDK executor as a defensive measure. Added integration test to verify float-to-integer conversion works correctly through the full MCP protocol flow.

@bgaidioz bgaidioz force-pushed the fix-integer-parameter-conversion branch from 59636a0 to 63c1a49 Compare September 1, 2025 16:02
@bgaidioz bgaidioz marked this pull request as draft January 16, 2026 16:24
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.

2 participants