Mastra Provider
Mastra is a TypeScript native framework for building agents with tools and MCPs. It expects tools to be in the following format:
- Inputs: What information the tool needs to run (defined with an
inputSchema
, often using Zod). - Outputs: The structure of the data the tool returns (defined with an outputSchema).
- Execution Logic: The code that performs the tool’s action.
- Description: Text that helps the agent understand what the tool does and when to use it.
More documentation here
The Mastra provider formats the Composio tools into this format along with the execution logic so that agents can call and execute the Composio tools.
Setup
TypeScript
You can specify the provider in the constructor.
TypeScript
Usage
The tools are passed to the agent as a parameter.
TypeScript