vishalhabib99 opened a new pull request, #21:
URL: https://github.com/apache/iotdb-mcp-server/pull/21
`export_query` and `export_table_query` annotate `filename` as `str = None`,
and both already treat `None` as "generate `dump_<id>_<timestamp>`". FastMCP
turns that into `{"default": null, "type": "string"}`, so a client that sends
the advertised default explicitly (`{"filename": null}`) is rejected before the
tool runs.
Found with [mcp-doctor](https://github.com/vishalhabib99/mcp-doctor)
(`none_default_type`), then reproduced with an in-memory `fastmcp.Client` on
fastmcp 4.0.11 / mcp 2.3.0 (what `fastmcp>=2.8.1` resolves to today), no IoTDB
running:
Before:
```
export_query filename schema: {"default": null, "type": "string"}
omitted: Error calling tool 'export_query': export_query requires
tree SQL dialect, ... (tool body ran)
explicit null: 1 validation error for call[export_query]
filename Input should be a valid string [type=string_type,
input_value=None, ...]
export_table_query: same validation error for explicit null
```
After (`str | None = None`):
```
export_query filename schema: {"anyOf": [{"type": "string"}, {"type":
"null"}], "default": null}
explicit null: Error calling tool 'export_query': export_query requires
tree SQL dialect, ... (tool body ran)
export_table_query: explicit null also reaches the tool body
```
Changes:
- `services/query.py`: `filename: str | None = None` on both tools. Nothing
else.
- `tests/test_tool_schemas.py`: registers the query tools on a real
`FastMCP` and checks that every parameter defaulting to `None` allows `null`.
It fails on the current branch with `['export_query.filename',
'export_table_query.filename']` and passes with this change.
`pytest tests`: 93 passed, 26 subtests passed.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]