UNPKG

@mastra/core

Version:

Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack.

32 lines (20 loc) 972 B
# Agent.listTools() The `.listTools()` 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 ```typescript await agent.listTools() ``` ## Parameters **options** (`{ requestContext?: RequestContext }`): Optional configuration object containing request context. (Default: `{}`) **options.requestContext** (`RequestContext`): Request Context for dependency injection and contextual information. ## 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 ```typescript await agent.listTools({ requestContext: new RequestContext(), }) ``` ## Related - [Using tools with agents](https://mastra.ai/docs/agents/using-tools) - [Creating tools](https://mastra.ai/docs/mcp/overview)