wpnav_list_taxonomies
Discover WordPress taxonomies like categories, tags, and custom types to understand your site's content structure. Filter by post type to organize content effectively.
Instructions
List all registered WordPress taxonomies (categories, tags, custom). Returns taxonomy name, labels, and capabilities. Always available for site structure discovery.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Filter by post type (e.g., "post", "page") |
Implementation Reference
- src/tools/taxonomy/index.ts:547-555 (handler)Handler function that constructs a query string from input args (optional 'type' filter), performs a GET request to the WordPress REST API `/wp/v2/taxonomies`, and returns the response as clamped JSON text content.handler: async (args, context) => { const qs = buildQueryString({ type: args.type }); const taxonomies = await context.wpRequest(`/wp/v2/taxonomies?${qs}`); return { content: [{ type: 'text', text: context.clampText(JSON.stringify(taxonomies, null, 2)) }], }; },
- src/tools/taxonomy/index.ts:540-545 (schema)Input schema for the tool, defining an optional 'type' string parameter to filter taxonomies by associated post type.type: 'object', properties: { type: { type: 'string', description: 'Filter by post type (e.g., "post", "page")' }, }, required: [], },
- src/tools/taxonomy/index.ts:535-557 (registration)Complete registration of the 'wpnav_list_taxonomies' tool in the taxonomy tools module, specifying name, description, input schema, handler function, and category.toolRegistry.register({ definition: { name: 'wpnav_list_taxonomies', description: 'List all registered WordPress taxonomies (categories, tags, custom). Returns taxonomy name, labels, and capabilities. Always available for site structure discovery.', inputSchema: { type: 'object', properties: { type: { type: 'string', description: 'Filter by post type (e.g., "post", "page")' }, }, required: [], }, }, handler: async (args, context) => { const qs = buildQueryString({ type: args.type }); const taxonomies = await context.wpRequest(`/wp/v2/taxonomies?${qs}`); return { content: [{ type: 'text', text: context.clampText(JSON.stringify(taxonomies, null, 2)) }], }; }, category: ToolCategory.TAXONOMY, });
- src/tools.ts:707-720 (schema)Duplicate schema definition for 'wpnav_list_taxonomies' in the central tools list, likely used for MCP tool discovery or type exports.{ name: 'wpnav_list_taxonomies', description: 'List all registered WordPress taxonomies (categories, tags, custom). Returns taxonomy name, labels, and capabilities. Always available for site structure discovery.', inputSchema: { type: 'object' as const, properties: { type: { type: 'string' as const, description: 'Filter by post type (e.g., "post", "page")', }, }, required: [], },