> Discover all available pages from the documentation index: https://mastra.zisheng.pro/llms.txt # Mastra.listTools() `.listTools()` 方法返回 Mastra 实例上配置的 Tool。返回记录以 Mastra 注册键作为键,以 Tool 实例作为值。 ## 使用示例 ```typescript import { Mastra } from '@mastra/core/mastra' import { weatherTool } from './tools/weather-tool' export const mastra = new Mastra({ tools: { weather: weatherTool, }, }) const tools = mastra.listTools() const weather = tools?.weather ``` ## 参数 此方法不接受任何参数。 ## 返回值 **tools** (`TTools | undefined`): Mastra 级 Tool 注册表,其中每个键都是注册键,每个值都是 Tool 实例。没有可用注册表时返回 undefined。 此方法列出 Mastra 级注册表,不包括仅存在于函数式 Agent `tools` 回调中的 Tool。 ## 相关内容 - [在 Agent 之间共享 Tool](https://mastra.zisheng.pro/docs/agents/using-tools) - [Mastra 类](https://mastra.zisheng.pro/reference/core/mastra-class) - [Mastra.getTool()](https://mastra.zisheng.pro/reference/core/getTool) - [Mastra.getToolById()](https://mastra.zisheng.pro/reference/core/getToolById)