HomeMastraOverview

Overview: Arcade Tools in Mastra

Mastra is an open-source TypeScript agent framework that provides essential primitives for building AI applications. Integrate Arcade’s extensive tool ecosystem to enhance your Mastra agents and enable them to interact seamlessly with numerous third-party services.

This integration enables you to:

  • Access a wide range of tools: Use Arcade’s pre-built tools for GitHub, Google Workspace, Slack, and more directly within your Mastra agent.
  • Simplify tool management: Let Arcade handle the complexities of tool discovery, execution, and authentication.
  • Build sophisticated agents: Combine Mastra’s agent framework (including memory, workflows, and RAG) with Arcade’s powerful tool capabilities.

How it Works

The integration works through four key mechanisms:

  1. Tool Discovery: Access available tools through a unified API (arcade.tools.formatted.list), formatted conveniently for AI models (like OpenAI function format).
  2. Schema Conversion: Convert Arcade’s JSON Schema tool definitions into Mastra’s expected Zod schemas using libraries like @dmitryrechkin/json-schema-to-zod.
  3. Execution Delegation: Route Mastra tool calls through the Arcade API (arcade.tools.execute) to handle third-party service interactions.
  4. Authorization Handling: Manage OAuth flows for user consent with Arcade, which returns specific responses for your agent to handle (arcade.tools.authorize).
Before starting, obtain an Arcade API key.

Next Steps