wpnav_get_plugin
Retrieve detailed metadata for a specific WordPress plugin, including description, author, and version information, using its unique slug identifier.
Instructions
Get details about a specific plugin by slug. Returns full metadata including description, author, and version.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plugin | Yes | Plugin identifier from wpnav_list_plugins "plugin" field (e.g., "wordfence/wordfence", "hello"). Do NOT include .php extension. |
Implementation Reference
- src/tools/plugins/index.ts:88-96 (handler)Executes the tool: validates 'plugin' arg, normalizes slug, calls WP REST API /wp/v2/plugins/{slug}, returns JSON response.handler: async (args, context) => { validateRequired(args, ['plugin']); const endpoint = `/wp/v2/plugins/${normalizePluginPath(args.plugin)}`; const plugin = await context.wpRequest(endpoint); return { content: [{ type: 'text', text: context.clampText(JSON.stringify(plugin, null, 2)) }], }; },
- src/tools/plugins/index.ts:80-86 (schema)Input schema defining required 'plugin' string parameter with description.inputSchema: { type: 'object', properties: { plugin: { type: 'string', description: 'Plugin identifier from wpnav_list_plugins "plugin" field (e.g., "wordfence/wordfence", "hello"). Do NOT include .php extension.' }, }, required: ['plugin'], },
- src/tools/plugins/index.ts:76-98 (registration)Full tool registration call to toolRegistry, including name, description, schema, handler, and category.toolRegistry.register({ definition: { name: 'wpnav_get_plugin', description: 'Get details about a specific plugin by slug. Returns full metadata including description, author, and version.', inputSchema: { type: 'object', properties: { plugin: { type: 'string', description: 'Plugin identifier from wpnav_list_plugins "plugin" field (e.g., "wordfence/wordfence", "hello"). Do NOT include .php extension.' }, }, required: ['plugin'], }, }, handler: async (args, context) => { validateRequired(args, ['plugin']); const endpoint = `/wp/v2/plugins/${normalizePluginPath(args.plugin)}`; const plugin = await context.wpRequest(endpoint); return { content: [{ type: 'text', text: context.clampText(JSON.stringify(plugin, null, 2)) }], }; }, category: ToolCategory.PLUGINS, });
- src/tools/plugins/index.ts:29-35 (helper)Helper function to normalize plugin identifiers (e.g., 'wordfence%2Fwordfence' -> 'wordfence/wordfence') for WP REST API paths.function normalizePluginPath(plugin: string): string { // First decode any URL-encoded characters (handles pre-encoded input from Claude Code) const decoded = decodeURIComponent(plugin); // Then encode individual parts but preserve the slash for /wp-json/ path format const result = decoded.split('/').map(part => encodeURIComponent(part)).join('/'); return result; }