File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 3030 - [ Prompts] ( #prompts )
3131 - [ Images] ( #images )
3232 - [ Context] ( #context )
33+ - [ Authentication] ( #authentication )
3334 - [ Running Your Server] ( #running-your-server )
3435 - [ Development Mode] ( #development-mode )
3536 - [ Claude Desktop Integration] ( #claude-desktop-integration )
3637 - [ Direct Execution] ( #direct-execution )
38+ - [ Streamable HTTP Transport] ( #streamable-http-transport )
3739 - [ Mounting to an Existing ASGI Server] ( #mounting-to-an-existing-asgi-server )
3840 - [ Examples] ( #examples )
3941 - [ Echo Server] ( #echo-server )
@@ -243,6 +245,15 @@ async def fetch_weather(city: str) -> str:
243245 async with httpx.AsyncClient() as client:
244246 response = await client.get(f " https://api.weather.com/ { city} " )
245247 return response.text
248+
249+ # Get a reference to the tool
250+ tool = mcp._tool_manager.get_tool(" fetch_weather" )
251+
252+ # Disable the tool temporarily
253+ await tool.disable(mcp.get_context())
254+
255+ # Later, re-enable the tool
256+ await tool.enable(mcp.get_context())
246257```
247258
248259### Prompts
You can’t perform that action at this time.
0 commit comments