From 58be2befae161554d26f1612bef2c0dd0075073f Mon Sep 17 00:00:00 2001 From: Aymeric Weinbach <397730+zecloud@users.noreply.github.com> Date: Thu, 1 Oct 2026 10:13:50 +0200 Subject: [PATCH] Fix McpPropertyType.FLOAT to emit JSON Schema 'number' type '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 #367 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- azure/functions/decorators/core.py | 4 ++-- tests/decorators/test_mcp.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/azure/functions/decorators/core.py b/azure/functions/decorators/core.py index cbd60b5..b9e3f7d 100644 --- a/azure/functions/decorators/core.py +++ b/azure/functions/decorators/core.py @@ -85,8 +85,8 @@ class McpPropertyType(StringifyEnum): """MCP property types.""" INTEGER = "integer" """Integer type.""" - FLOAT = "float" - """Float type.""" + FLOAT = "number" + """Float type represented as the JSON Schema "number" type.""" STRING = "string" """String type.""" BOOLEAN = "boolean" diff --git a/tests/decorators/test_mcp.py b/tests/decorators/test_mcp.py index 7a07e44..989153b 100644 --- a/tests/decorators/test_mcp.py +++ b/tests/decorators/test_mcp.py @@ -389,7 +389,7 @@ def add_numbers(a) -> int: self.assertEqual(trigger.tool_name, "add_numbers") self.assertEqual(trigger.tool_properties, '[{"propertyName": "a", ' - '"propertyType": "float", ' + '"propertyType": "number", ' '"description": "", ' '"isArray": false, ' '"isRequired": true}]')