MCPcopy Index your code
hub / github.com/modelcontextprotocol/python-sdk / call_tool

Method call_tool

src/mcp/server/mcpserver/server.py:389–395  ·  view source on GitHub ↗

Call a tool by name with arguments.

(
        self, name: str, arguments: dict[str, Any], context: Context[LifespanResultT, Any] | None = None
    )

Source from the content-addressed store, hash-verified

387 ]
388
389 async def call_tool(
390 self, name: str, arguments: dict[str, Any], context: Context[LifespanResultT, Any] | None = None
391 ) -> CallToolResult | InputRequiredResult:
392 """Call a tool by name with arguments."""
393 if context is None:
394 context = Context(mcp_server=self)
395 return await self._tool_manager.call_tool(name, arguments, context, convert_result=True)
396
397 async def list_resources(self) -> list[MCPResource]:
398 """List all available resources."""

Calls 1

ContextClass · 0.90