Class: Tools
Methods
list()
List all available tools from configured MCP servers. Returns:list[ToolDefinition]
Example:
call()
Call a tool by name with arguments. Parameters:| Parameter | Type | Required | Description |
|---|---|---|---|
name | str | Yes | Tool identifier |
args | dict | Yes | Arguments matching tool’s input schema |
dict - Tool output parsed from JSON
Raises: ToolCallError on tool execution failure
Example:
ToolDefinition
Configuration
MCP servers are configured in the@agent decorator:
Error Handling
Finding Tools
Filter by name pattern:Dynamic Tool Selection
Real Example: Time Operations
Multiple MCP Servers
Tools from all configured servers are merged into a single namespace:Tool Chaining
Schema Inspection
Common MCP Servers
| Server | Package | Tools |
|---|---|---|
| GitHub | @modelcontextprotocol/server-github | search_issues, get_issue, create_issue, add_comment, etc. |
| PostgreSQL | @modelcontextprotocol/server-postgres | query, list_tables, describe_table |
| Time | mcp-server-time | get_current_time, convert_time |
| Filesystem | @modelcontextprotocol/server-filesystem | read_file, write_file, list_directory |
| Fetch | @modelcontextprotocol/server-fetch | fetch (HTTP requests) |
Transport Types
Currently supported:stdio
Planned: sse (Server-Sent Events)
Environment Variables
Pass environment variables directly to MCP server processes:ctx.env, use the environment decorator field:
See Also
How to Use MCP Tools
Task-oriented guide
MCP Specification
Official protocol documentation
MCP Servers Registry
Community server directory

