Commit 92f361b
fix: correct return type annotation for MCPServer.call_tool()
The return type was annotated as Sequence[ContentBlock] | dict[str, Any]
but the actual return types from convert_result() are:
- Sequence[ContentBlock] (when no output schema)
- tuple[Sequence[ContentBlock], dict[str, Any]] (when output schema is set)
- CallToolResult (when tool returns CallToolResult directly)
The dict[str, Any] variant was unreachable, as noted by a TODO comment
in _handle_call_tool. Update the annotation to match the actual behavior
and remove the stale TODO.
Fixes #1251
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 62575ed commit 92f361b
1 file changed
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | 318 | | |
322 | 319 | | |
323 | 320 | | |
| |||
399 | 396 | | |
400 | 397 | | |
401 | 398 | | |
402 | | - | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
403 | 402 | | |
404 | 403 | | |
405 | 404 | | |
| |||
0 commit comments