Skip to main content

ToolProvider

The ToolProvider interface defines how the editor discovers and resolves integration tools from external platforms. Mastra ships with two built-in implementations: ComposioToolProvider and ArcadeToolProvider.

See Tools for a guide on setting up tool providers.

ToolProvider interface
Direct link to ToolProvider interface

Tool providers implement these methods:

listToolkits():

() => Promise<Toolkit[]>
Returns a list of available toolkits (tool categories) from the provider.

listTools(params?):

(params?) => Promise<Tool[]>
Returns a list of available tools. Accepts optional filtering by toolkit, search query, and limit.

getToolSchema(slug):

(slug: string) => Promise<JSONSchema>
Returns the JSON schema for a specific tool identified by its slug.

resolveTools(slugs, options?):

(slugs: string[], options?) => Promise<Record<string, ToolAction>>
Resolves tool slugs into executable Mastra tool actions. The options object can include userId for per-user authentication.

ComposioToolProvider
Direct link to ComposioToolProvider

Connects to Composio for access to hundreds of integration tools.

Usage example
Direct link to Usage example

src/mastra/index.ts
import { MastraEditor } from '@mastra/editor'
import { ComposioToolProvider } from '@mastra/editor/providers/composio'

const editor = new MastraEditor({
toolProviders: {
composio: new ComposioToolProvider({
apiKey: process.env.COMPOSIO_API_KEY!,
}),
},
})

Constructor parameters
Direct link to Constructor parameters

apiKey:

string
Your Composio API key.

Tool slugs
Direct link to Tool slugs

Composio tools use uppercase slug format: GITHUB_CREATE_ISSUE, SLACK_SEND_MESSAGE.

Authentication
Direct link to Authentication

Tool execution is scoped to a userId passed through request context. Each user authenticates with the integration separately through Composio's auth flow.


ArcadeToolProvider
Direct link to ArcadeToolProvider

Connects to Arcade for a curated tool catalog with built-in authentication.

Usage example
Direct link to Usage example

src/mastra/index.ts
import { MastraEditor } from '@mastra/editor'
import { ArcadeToolProvider } from '@mastra/editor/providers/arcade'

const editor = new MastraEditor({
toolProviders: {
arcade: new ArcadeToolProvider({
apiKey: process.env.ARCADE_API_KEY!,
}),
},
})

Constructor parameters
Direct link to Constructor parameters

apiKey:

string
Your Arcade API key.

baseURL?:

string
Custom base URL for the Arcade API.

Tool slugs
Direct link to Tool slugs

Arcade tools use Toolkit.ToolName format: Github.GetRepository, Slack.SendMessage.

Authentication
Direct link to Authentication

Like Composio, tool execution requires a userId for per-user authorization through Arcade's auth flow.