fastmcp/tests
Aidan Allchin b9cde3bdb6
Fix: Include signature modification in create_function_without_params (#2563)
* Fix: Include signature modification in create_function_without_params

When excluding parameters via create_function_without_params(), only
__annotations__ was being updated but not __signature__. This caused
Pydantic's _arguments_schema() to fail when it iterated over signature
parameters that didn't exist in the type hints dictionary.

The fix adds proper signature reconstruction matching the pattern used
in without_injected_parameters().
Fixes KeyError: 'ctx' when using @mcp.tool() with Context parameters.

* fix: add regression tests for create_function_without_params

The test_pydantic_typeadapter_compatibility test specifically reproduces the issue from #2562 and verifies the fix.

* fix: linter for test function

---------

Co-authored-by: Jeremiah Lowin <153965+jlowin@users.noreply.github.com>
2025-12-06 11:57:36 -05:00
..
cli Remove enable_docket setting; Docket is now always on 2025-12-05 11:40:04 -05:00
client Fix type errors for ty 0.0.1-alpha.31 upgrade (#2561) 2025-12-05 21:29:14 -05:00
contrib feat: Add title, annotations and meta to mixin decorators 2025-10-10 14:23:02 +05:30
deprecated Switch to new OpenAPI parser as default (#2513) 2025-12-01 20:29:18 -05:00
experimental Switch to new OpenAPI parser as default (#2513) 2025-12-01 20:29:18 -05:00
integration_tests Improve rate limit detection for integration tests 2025-12-04 11:52:40 -05:00
prompts Enable more type checking rules (#1775) 2025-09-07 11:11:44 -04:00
resources Fix type errors for ty 0.0.1-alpha.31 upgrade (#2561) 2025-12-05 21:29:14 -05:00
server Fix type errors for ty 0.0.1-alpha.31 upgrade (#2561) 2025-12-05 21:29:14 -05:00
tools [2.14] SEP-1686 tasks (#2378) 2025-12-04 20:10:35 -05:00
utilities Fix: Include signature modification in create_function_without_params (#2563) 2025-12-06 11:57:36 -05:00
__init__.py Update type handling for resources 2024-11-29 19:42:46 -05:00
conftest.py fix: skip wait_closed() on Windows to avoid socket shutdown hang 2025-12-05 12:30:27 -05:00
test_examples.py Cleanup content conversion 2025-09-06 17:32:33 -05:00
test_mcp_config.py Bump ty to ==0.0.1a25 (#2350) 2025-11-02 20:02:45 -05:00