We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1e4f570 commit fd71115Copy full SHA for fd71115
README.md
@@ -247,16 +247,17 @@ async def fetch_weather(city: str) -> str:
247
return response.text
248
249
250
-# Get a reference to the tool
251
tool = mcp._tool_manager.get_tool("fetch_weather")
252
253
254
-# Disable the tool temporarily
255
-await tool.disable(mcp.get_context())
+async def disable_tool():
+ # Disable the tool temporarily
+ await tool.disable(mcp.get_context())
256
257
258
-# Later, re-enable the tool
259
-await tool.enable(mcp.get_context())
+async def enable_tool():
+ # Re-enable the tool when needed
260
+ await tool.enable(mcp.get_context())
261
```
262
263
### Prompts
0 commit comments