wpnav_describe_tools
Retrieve detailed input schemas for WordPress management tools to understand required parameters before execution.
Instructions
Get full input schemas for specific WP Navigator tools. Call this after using wpnav_search_tools to get the schemas you need before calling wpnav_execute.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tools | Yes | Array of tool names to describe (e.g., ["wpnav_create_post", "wpnav_update_post"]). Maximum 10 tools per request. |
Implementation Reference
- src/tools/core/describe-tools.ts:84-172 (handler)The core handler function that implements the logic for wpnav_describe_tools. It validates input, fetches tool definitions from the registry, formats categories, and returns JSON schemas for the requested tools.export async function describeToolsHandler( args: { tools: string[] }, // eslint-disable-next-line @typescript-eslint/no-unused-vars context: ToolExecutionContext ): Promise<ToolResult> { const { tools: requestedTools } = args; // Validate input if (!Array.isArray(requestedTools)) { return { content: [ { type: 'text', text: JSON.stringify( { error: 'INVALID_INPUT', message: 'tools must be an array of tool names', }, null, 2 ), }, ], }; } if (requestedTools.length === 0) { return { content: [ { type: 'text', text: JSON.stringify( { error: 'INVALID_INPUT', message: 'tools array cannot be empty', hint: 'Use wpnav_search_tools to find tools first', }, null, 2 ), }, ], }; } // Enforce max items limit const toolsToDescribe = requestedTools.slice(0, MAX_TOOLS); const truncated = requestedTools.length > MAX_TOOLS; // Build response const response: DescribeToolsResponse = { tools: [], not_found: [], }; for (const toolName of toolsToDescribe) { const tool = toolRegistry.getTool(toolName); if (!tool) { response.not_found.push(toolName); continue; } // Get category name const categoryName = CATEGORY_NAMES[tool.category] || 'other'; response.tools.push({ name: tool.definition.name, description: tool.definition.description || '', inputSchema: tool.definition.inputSchema, category: categoryName, }); } // Add truncation warning if applicable const result: Record<string, unknown> = { ...response }; if (truncated) { result.warning = `Only first ${MAX_TOOLS} tools described. Request contained ${requestedTools.length} tools.`; } return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- The input schema and metadata definition for the wpnav_describe_tools tool.export const describeToolsDefinition = { name: 'wpnav_describe_tools', description: 'Get full input schemas for specific WP Navigator tools. Call this after using wpnav_search_tools to get the schemas you need before calling wpnav_execute.', inputSchema: { type: 'object' as const, properties: { tools: { type: 'array', items: { type: 'string' }, maxItems: MAX_TOOLS, description: `Array of tool names to describe (e.g., ["wpnav_create_post", "wpnav_update_post"]). Maximum ${MAX_TOOLS} tools per request.`, }, }, required: ['tools'], }, };
- src/tools/core/describe-tools.ts:177-183 (registration)The registration function that adds wpnav_describe_tools to the tool registry with its definition and handler.export function registerDescribeTools(): void { toolRegistry.register({ definition: describeToolsDefinition, handler: describeToolsHandler, category: ToolCategory.CORE, }); }
- src/tools/core/index.ts:337-337 (registration)The call to register the wpnav_describe_tools tool during core tools initialization.registerDescribeTools();
- src/mcp-server.ts:71-77 (registration)Inclusion of wpnav_describe_tools in the META_TOOLS set, making it directly accessible via MCP ListTools and CallTool without needing dynamic execution.const META_TOOLS = new Set([ 'wpnav_introspect', 'wpnav_search_tools', 'wpnav_describe_tools', 'wpnav_execute', 'wpnav_context', ]);