> Discover all available pages from the documentation index: https://mastra.zisheng.pro/fr/llms.txt # Mastra.getTool() La méthode `.getTool()` récupère un Tool depuis le registre au niveau de Mastra à partir de sa clé d’enregistrement. ## Exemple d’utilisation Enregistrez un Tool sous la clé `weather`, puis utilisez cette clé pour le récupérer. ```typescript import { Mastra } from '@mastra/core/mastra' import { weatherTool } from './tools/weather-tool' export const mastra = new Mastra({ tools: { weather: weatherTool, }, }) const tool = mastra.getTool('weather') ``` ## Paramètres **name** (`TToolName extends keyof TTools`): Clé d’enregistrement du Tool dans le registre Mastra tools. ## Voir aussi - [Partager des Tools entre les agents](https://mastra.zisheng.pro/fr/docs/agents/using-tools) - [Classe Mastra](https://mastra.zisheng.pro/fr/reference/core/mastra-class) - [Mastra.getToolById()](https://mastra.zisheng.pro/fr/reference/core/getToolById) - [Mastra.listTools()](https://mastra.zisheng.pro/fr/reference/core/listTools)