Tools API
The Tools API provides methods to interact with and execute tools available in the Mastra platform.
Getting all toolsDirect link to Getting all tools
Retrieve a list of all available tools:
const tools = await mastraClient.listTools()
Working with a specific toolDirect link to Working with a specific tool
Get an instance of a specific tool:
const tool = mastraClient.getTool('tool-id')
Tool methodsDirect link to Tool methods
Get tool detailsDirect link to Get tool details
Retrieve detailed information about a tool:
const details = await tool.details()
Execute toolDirect link to Execute tool
Execute a tool with specific arguments:
const result = await tool.execute({
data: {
param1: 'value1',
param2: 'value2',
},
runId: 'run-1', // Optional: Run identifier
})