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({
args: {
param1: 'value1',
param2: 'value2',
},
threadId: 'thread-1', // Optional: Thread context
resourceId: 'resource-1', // Optional: Resource identifier
})