inspector
inspector copied to clipboard
input schema: anyOf integer, string not handled correctly
Inspector Version
- 0.17.2
Describe the bug I have a tool that accepts either an integer or a string for one of its parameters. I'm using FastMCP in Python, and the function signature looks something like this:
def my_tool(arg1: Annotated[FilePath, Field(description="...")], factor: Annotated[str | Annotated[int, Field(ge=1)], Field(description="...")]=1) -> ToolResult
The produced input schema looks fine:
"factor": {
"anyOf": [
{
"type": "string"
},
{
"minimum": 1,
"type": "integer"
}
],
"default": 1,
"description": "..."
}
However, the input field shown in the inspector does not show the description and appears to only accept integers, if I input something that cannot be parsed as integer I get an error message JSON.parse: unexpected character at line 1 column 1 of the JSON data.
Environment (please complete the following information):
- OS: Linux
- Browser: Firefox