Skip to main content
Mastra 1.0 is available 🎉 Read announcement

Agent.getTools()

The .getTools() method retrieves the tools configured for an agent, resolving them if they're a function. These tools extend the agent's capabilities, allowing it to perform specific actions or access external systems.

Usage example
Direct link to Usage example

await agent.getTools();

Parameters
Direct link to Parameters

options?:

{ requestContext?: RequestContext }
= {}
Optional configuration object containing runtime context.

Returns
Direct link to Returns

tools:

TTools | Promise<TTools>
The tools configured for the agent, either as a direct object or a promise that resolves to the tools.

Extended usage example
Direct link to Extended usage example

await agent.getTools({
requestContext: new RequestContext(),
});

Options parameters
Direct link to Options parameters

requestContext?:

RequestContext
= new RequestContext()
Runtime context for dependency injection and contextual information.
On this page