Fix McpPropertyType.FLOAT to emit JSON Schema 'number' type - #368
Open
Aymeric Weinbach (zecloud) wants to merge 1 commit into
Open
Aymeric Weinbach (zecloud) wants to merge 1 commit into
Aymeric Weinbach (zecloud) wants to merge 1 commit into
Conversation
'float' is not a valid JSON Schema type, so MCP clients reject tool inputSchema generated from McpPropertyType.FLOAT. Type-hint inference already maps float to 'number'; align the explicit enum with it. Fixes Azure#367 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Aymeric Weinbach (zecloud)
requested review from
Gavin Aguiar (gavin-aguiar),
hallvictoria and
Varad Meru (vrdmr)
as code owners
October 1, 2026 08:14
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Copilot started reviewing on behalf of
Aymeric Weinbach (zecloud)
October 1, 2026 08:15
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused fix aligns explicit float declarations with JSON Schema and existing type inference behavior.
Review effort: Balanced
Findings: None
What changed in this PR
Corrects MCP float properties to emit valid JSON Schema.
Changes:
- Maps
McpPropertyType.FLOATto"number". - Updates the corresponding decorator test expectation.
| File | Description |
|---|---|
azure/functions/decorators/core.py |
Corrects the float wire type. |
tests/decorators/test_mcp.py |
Verifies "number" serialization. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Fixes #367.
McpPropertyType.FLOATwas"float", which is not a valid JSON Schema type. Explicit@app.mcp_tool_property(property_type=McpPropertyType.FLOAT)declarations, which take precedence over type-hint inference, therefore produced an MCPinputSchemathat strict clients reject (for example:400 Invalid schema ... 'float' is not valid under any of the given schemas).This change sets
FLOAT = "number", consistent with_TYPE_MAPPINGinmcp.py(float -> number) and with the existingDATETIME = "string"pattern. The expectation intest_mcp_property_input_enum_floatis updated accordingly.Tests:
pytest tests/decorators/test_mcp.py tests/test_mcp.py, 97 passed.