Get Tool Help
get-tool-helpRetrieve detailed information, including input schema and parameters, for any tool in the MCP Firebird server to understand its purpose and usage.
Instructions
Obtiene información detallada sobre una herramienta específica
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| toolName | Yes | Nombre de la herramienta sobre la que obtener ayuda |
Implementation Reference
- src/tools/metadata.ts:136-177 (handler)The handler function for the 'get-tool-help' tool. It looks up a tool by name in the combined map of database and metadata tools, and returns detailed help information (name, title, description, category, inputSchema, usage) formatted via formatForClaude.
handler: async (args: { toolName: string }) => { try { const allTools = new Map([...databaseTools, ...tools]); const tool = allTools.get(args.toolName); if (!tool) { return { content: [{ type: 'text', text: `Herramienta '${args.toolName}' no encontrada. Use 'list-available-tools' para ver las herramientas disponibles.` }], isError: true }; } const helpInfo = { name: args.toolName, title: tool.title || args.toolName, description: tool.description, category: databaseTools.has(args.toolName) ? 'database' : 'metadata', inputSchema: tool.inputSchema ? 'Disponible' : 'No definido', usage: `Para usar esta herramienta, llame a '${args.toolName}' con los parámetros apropiados.` }; return { content: [{ type: 'text', text: `Ayuda para la herramienta: ${args.toolName}\n\n${formatForClaude(helpInfo)}` }] }; } catch (error) { logger.error('Error getting tool help:', { error }); return { content: [{ type: 'text', text: `Error obteniendo ayuda: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } }); - src/tools/metadata.ts:133-135 (schema)Input schema for 'get-tool-help' using Zod. Expects a single required string parameter 'toolName' representing the name of the tool to get help about.
inputSchema: z.object({ toolName: z.string().describe('Nombre de la herramienta sobre la que obtener ayuda') }), - src/tools/metadata.ts:130-177 (registration)Registration of the 'get-tool-help' tool in the metadata tools map via tools.set(). It sets the title, description, inputSchema, and handler.
tools.set('get-tool-help', { title: 'Get Tool Help', description: 'Obtiene información detallada sobre una herramienta específica', inputSchema: z.object({ toolName: z.string().describe('Nombre de la herramienta sobre la que obtener ayuda') }), handler: async (args: { toolName: string }) => { try { const allTools = new Map([...databaseTools, ...tools]); const tool = allTools.get(args.toolName); if (!tool) { return { content: [{ type: 'text', text: `Herramienta '${args.toolName}' no encontrada. Use 'list-available-tools' para ver las herramientas disponibles.` }], isError: true }; } const helpInfo = { name: args.toolName, title: tool.title || args.toolName, description: tool.description, category: databaseTools.has(args.toolName) ? 'database' : 'metadata', inputSchema: tool.inputSchema ? 'Disponible' : 'No definido', usage: `Para usar esta herramienta, llame a '${args.toolName}' con los parámetros apropiados.` }; return { content: [{ type: 'text', text: `Ayuda para la herramienta: ${args.toolName}\n\n${formatForClaude(helpInfo)}` }] }; } catch (error) { logger.error('Error getting tool help:', { error }); return { content: [{ type: 'text', text: `Error obteniendo ayuda: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } }); - src/server/create-server.ts:62-62 (registration)The 'get-tool-help' tool (along with other metadata tools) is registered into the server by calling setupMetadataTools(databaseTools) and merging the result into the allTools map.
const metadataTools = setupMetadataTools(databaseTools); - src/utils/jsonHelper.ts:37-51 (helper)The formatForClaude helper utility used by the handler to format the help info object into a readable string for output.
export const formatForClaude = (result: any): string => { try { // For simple strings, return them directly if (typeof result === 'string') { return result; } // For objects, convert them to a pretty JSON string return JSON.stringify(result, null, 2); } catch (error) { // Handle JSON.stringify errors console.error(`Error formatting for Claude: ${error instanceof Error ? error.message : String(error)}`); return `Error formatting result: ${error instanceof Error ? error.message : String(error)}`; } };