wpnav_list_plugins
List installed WordPress plugins with details like name, version, and status to manage activation, deactivation, or deletion operations.
Instructions
List all installed WordPress plugins. Returns plugin identifier in "plugin" field (use this exact value for activate/deactivate/delete operations), name, version, and status (active/inactive). Format varies: single-file plugins use just the name (e.g., "hello"), directory plugins use "directory/file" without .php extension (e.g., "wordfence/wordfence", "wp-navigator-pro/wp-navigator-pro").
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | No | Optional filter by status (e.g., "active" or "inactive"). If omitted or set to "all", returns all plugins. |
Implementation Reference
- src/tools/plugins/index.ts:56-69 (handler)The handler function executes the tool logic: constructs query params for optional status filter, calls WP REST API /wp/v2/plugins endpoint via context.wpRequest, and returns JSON stringified plugins list.handler: async (args, context) => { const params = new URLSearchParams(); if (args.status && args.status !== 'all') { params.append('status', args.status); } const qs = params.toString(); const endpoint = qs ? `/wp/v2/plugins?${qs}` : '/wp/v2/plugins'; const plugins = await context.wpRequest(endpoint); return { content: [{ type: 'text', text: context.clampText(JSON.stringify(plugins, null, 2)) }], }; },
- src/tools/plugins/index.ts:48-54 (schema)Input schema definition for the wpnav_list_plugins tool, defining optional 'status' parameter.inputSchema: { type: 'object', properties: { status: { type: 'string', description: 'Optional filter by status (e.g., "active" or "inactive"). If omitted or set to "all", returns all plugins.' }, }, required: [], },
- src/tools/plugins/index.ts:44-71 (registration)Registration of the wpnav_list_plugins tool using toolRegistry.register, including full definition, handler, and category.toolRegistry.register({ definition: { name: 'wpnav_list_plugins', description: 'List all installed WordPress plugins. Returns plugin identifier in "plugin" field (use this exact value for activate/deactivate/delete operations), name, version, and status (active/inactive). Format varies: single-file plugins use just the name (e.g., "hello"), directory plugins use "directory/file" without .php extension (e.g., "wordfence/wordfence", "wp-navigator-pro/wp-navigator-pro").', inputSchema: { type: 'object', properties: { status: { type: 'string', description: 'Optional filter by status (e.g., "active" or "inactive"). If omitted or set to "all", returns all plugins.' }, }, required: [], }, }, handler: async (args, context) => { const params = new URLSearchParams(); if (args.status && args.status !== 'all') { params.append('status', args.status); } const qs = params.toString(); const endpoint = qs ? `/wp/v2/plugins?${qs}` : '/wp/v2/plugins'; const plugins = await context.wpRequest(endpoint); return { content: [{ type: 'text', text: context.clampText(JSON.stringify(plugins, null, 2)) }], }; }, category: ToolCategory.PLUGINS, });