Get Tools • AI Agent SDK
get_tools: Get the list of tool functions from this MCP instance.
get_tools
Method
</div>
Get the list of tool functions from this MCP instance.
This method provides explicit access to the tools list, which is useful when you need to inspect or manipulate the tools programmatically.
Signature
def get_tools() -> List[Callable]Returns
ResponseField
List[Callable]List of tool functions that can be called
Usage
# Point the filesystem server at any directory the agent may access.
# Use a platform-appropriate path (e.g. "." for the current dir);
# on Windows npx may need to be invoked as "npx.cmd".
mcp = MCP("npx -y @modelcontextprotocol/server-filesystem .")
tools = mcp.get_tools()
for tool in tools:
print(f"Tool: {tool.__name__}")Source
View on GitHubpraisonaiagents/mcp/mcp.py at line 1311