docs/src/content/en/reference/agents/getTools.mdx
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.
await agent.getTools()
<PropertiesTable content={[ { name: 'options', type: '{ requestContext?: RequestContext }', isOptional: true, defaultValue: '{}', description: 'Optional configuration object containing runtime context.', properties: [ { type: '{ requestContext?: RequestContext }', parameters: [ { name: 'requestContext', type: 'RequestContext', isOptional: true, defaultValue: 'new RequestContext()', description: 'Runtime context for dependency injection and contextual information.', }, ], }, ], }, ]} />
<PropertiesTable content={[ { name: 'tools', type: 'TTools | Promise<TTools>', description: 'The tools configured for the agent, either as a direct object or a promise that resolves to the tools.', }, ]} />
await agent.getTools({
requestContext: new RequestContext(),
})