Using Tools with Agents
Agents can automatically call tools based on their descriptions and schemas:Using Tools in Workflows
Tools can be called as workflow steps:Direct Tool Execution
Call tools directly for testing or programmatic use:Tool Execution with Context
Pass context for access to Mastra resources:Handling Tool Approval
For tools marked withrequireApproval: true, implement approval handling:
Streaming Tool Output
Stream tool output in real-time:Error Handling
Handle tool execution errors gracefully:Validation Errors
Validation errors are automatically returned when input doesn’t match the schema:Dynamic Tool Selection
Agents automatically select appropriate tools based on the conversation:Next Steps
Creating Tools
Learn how to create custom tools
MCP Overview
Connect tools via Model Context Protocol