ToolProvider
The ToolProvider interface defines how the editor discovers and resolves integration tools from external platforms. Mastra includes two built-in implementations: ComposioToolProvider and ArcadeToolProvider.
See Editor tools for provider setup and the Studio workflow. See tool configuration for stored selections and resolution behavior.
ToolProvider interfaceDirect link to ToolProvider interface
Providers expose metadata and the legacy discovery and resolution methods. Agent Builder integrations can also implement the optional VNext catalog, connection, authorization, and health methods.
info:
displayName?:
capabilities?:
defaultScope?:
listToolkits()?:
listTools(params?):
getToolSchema(slug)?:
resolveTools(slugs, configs?, options?):
listToolkitsVNext()?:
listToolsVNext(options?)?:
resolveToolsVNext(options)?:
listConnectionFields(options)?:
getAuthStatus(authId)?:
getConnectionStatus(options)?:
listConnections(options)?:
getHealth()?:
revokeConnection(connectionId)?:
ComposioToolProviderDirect link to ComposioToolProvider
Connects to Composio for access to hundreds of integration tools.
Usage exampleDirect link to Usage example
import { MastraEditor } from '@mastra/editor'
import { ComposioToolProvider } from '@mastra/editor/composio'
const editor = new MastraEditor({
toolProviders: {
composio: new ComposioToolProvider({
apiKey: process.env.COMPOSIO_API_KEY!,
}),
},
})
Constructor parametersDirect link to Constructor parameters
apiKey:
allowedToolkits?:
allowedTools?:
defaultScope?:
Tool slugsDirect link to Tool slugs
Composio tools use uppercase slug format: GITHUB_CREATE_ISSUE, SLACK_SEND_MESSAGE.
AuthenticationDirect link to Authentication
Connections use per-author scope by default. Set defaultScope: 'caller-supplied' to bucket authorization by the caller identity resolved from MASTRA_RESOURCE_ID_KEY in request context. Ensure each authenticated request provides a stable, unique resource ID. When using MastraAuthWorkos, configure mapUserToResourceId to set this value from the authenticated user.
Connection management toolsDirect link to Connection management tools
Composio provides tools for starting and monitoring authorization from an agent chat. When allowedToolkits is set, include composio to make these tools available:
const editor = new MastraEditor({
toolProviders: {
composio: new ComposioToolProvider({
apiKey: process.env.COMPOSIO_API_KEY!,
allowedToolkits: ['composio', 'gmail'],
defaultScope: 'caller-supplied',
}),
},
})
Add only the connection management tools that the agent needs:
| Tool | Behavior |
|---|---|
COMPOSIO_MANAGE_CONNECTIONS | Creates an authorization link in chat through a session owned by the caller. |
COMPOSIO_WAIT_FOR_CONNECTIONS | Waits for the caller to finish authorization before the agent continues. |
COMPOSIO_WAIT_FOR_CONNECTIONS is optional. Without it, complete authorization and return to the chat. Then ask the agent to continue. The connected account remains associated with the caller resource ID for later requests.
ArcadeToolProviderDirect link to ArcadeToolProvider
Connects to Arcade for a curated tool catalog with built-in authentication.
Usage exampleDirect link to Usage example
import { MastraEditor } from '@mastra/editor'
import { ArcadeToolProvider } from '@mastra/editor/arcade'
const editor = new MastraEditor({
toolProviders: {
arcade: new ArcadeToolProvider({
apiKey: process.env.ARCADE_API_KEY!,
}),
},
})
Constructor parametersDirect link to Constructor parameters
apiKey:
baseURL?:
Tool slugsDirect link to Tool slugs
Arcade tools use Toolkit.ToolName format: Github.GetRepository, Slack.SendMessage.
AuthenticationDirect link to Authentication
The legacy Arcade resolver uses resourceId from request context when available. It otherwise falls back to the supplied userId, then to a shared default identity. Use default only for intentionally shared integrations. In tenant-isolated deployments, provide a trusted, stable resourceId or explicit userId. Omitting both doesn't isolate callers.