Jeremiah Lowin commited on
Commit
cb39c37
·
unverified ·
1 Parent(s): 49e6154

Remove unused arg (#1382)

Browse files
src/fastmcp/server/server.py CHANGED
@@ -140,19 +140,18 @@ class FastMCP(Generic[LifespanResultT]):
140
  ]
141
  | None
142
  ) = None,
143
- tool_serializer: Callable[[Any], str] | None = None,
144
- cache_expiration_seconds: float | None = None,
145
- on_duplicate_tools: DuplicateBehavior | None = None,
146
- on_duplicate_resources: DuplicateBehavior | None = None,
147
- on_duplicate_prompts: DuplicateBehavior | None = None,
148
  resource_prefix_format: Literal["protocol", "path"] | None = None,
149
  mask_error_details: bool | None = None,
150
  tools: list[Tool | Callable[..., Any]] | None = None,
151
  tool_transformations: dict[str, ToolTransformConfig] | None = None,
152
- dependencies: list[str] | None = None,
153
  include_tags: set[str] | None = None,
154
  exclude_tags: set[str] | None = None,
155
  include_fastmcp_meta: bool | None = None,
 
 
 
156
  # ---
157
  # ---
158
  # --- The following arguments are DEPRECATED ---
 
140
  ]
141
  | None
142
  ) = None,
143
+ dependencies: list[str] | None = None,
 
 
 
 
144
  resource_prefix_format: Literal["protocol", "path"] | None = None,
145
  mask_error_details: bool | None = None,
146
  tools: list[Tool | Callable[..., Any]] | None = None,
147
  tool_transformations: dict[str, ToolTransformConfig] | None = None,
148
+ tool_serializer: Callable[[Any], str] | None = None,
149
  include_tags: set[str] | None = None,
150
  exclude_tags: set[str] | None = None,
151
  include_fastmcp_meta: bool | None = None,
152
+ on_duplicate_tools: DuplicateBehavior | None = None,
153
+ on_duplicate_resources: DuplicateBehavior | None = None,
154
+ on_duplicate_prompts: DuplicateBehavior | None = None,
155
  # ---
156
  # ---
157
  # --- The following arguments are DEPRECATED ---
tests/deprecated/test_settings.py CHANGED
@@ -176,7 +176,6 @@ class TestDeprecatedServerInitKwargs:
176
  server = FastMCP(
177
  name="TestServer",
178
  instructions="Test instructions",
179
- cache_expiration_seconds=60.0,
180
  on_duplicate_tools="warn",
181
  on_duplicate_resources="error",
182
  on_duplicate_prompts="replace",
 
176
  server = FastMCP(
177
  name="TestServer",
178
  instructions="Test instructions",
 
179
  on_duplicate_tools="warn",
180
  on_duplicate_resources="error",
181
  on_duplicate_prompts="replace",
tests/server/test_mount.py CHANGED
@@ -637,23 +637,9 @@ class TestDynamicChanges:
637
  sub_app._tool_manager._tools.pop("temp_tool")
638
 
639
  # The tool should no longer be accessible
640
- # Refresh the cache by clearing it
641
  tools = await main_app.get_tools()
642
  assert "sub_temp_tool" not in tools
643
 
644
- async def test_cache_expiration(self):
645
- main_app = FastMCP("MainApp", cache_expiration_seconds=2)
646
- sub_app = FastMCP("SubApp")
647
- tools = await main_app.get_tools()
648
- assert len(tools) == 0
649
-
650
- @sub_app.tool
651
- def sub_tool():
652
- return "sub_tool"
653
-
654
- tools = await main_app.get_tools()
655
- assert len(tools) == 0
656
-
657
 
658
  class TestResourcesAndTemplates:
659
  """Test mounting with resources and resource templates."""
 
637
  sub_app._tool_manager._tools.pop("temp_tool")
638
 
639
  # The tool should no longer be accessible
 
640
  tools = await main_app.get_tools()
641
  assert "sub_temp_tool" not in tools
642
 
 
 
 
 
 
 
 
 
 
 
 
 
 
643
 
644
  class TestResourcesAndTemplates:
645
  """Test mounting with resources and resource templates."""