wpnav_get_taxonomy
Retrieve detailed configuration for WordPress taxonomies to understand site structure, including hierarchical status, REST base, and labels.
Instructions
Get details about a specific taxonomy by name. Returns full taxonomy configuration including hierarchical status, REST base, and labels. Always available for site structure discovery.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| taxonomy | Yes | Taxonomy name (e.g., "category", "post_tag", or custom taxonomy) |
Implementation Reference
- src/tools/taxonomy/index.ts:571-579 (handler)The handler function for 'wpnav_get_taxonomy'. Validates the required 'taxonomy' parameter, fetches the taxonomy details from the WordPress REST API endpoint `/wp/v2/taxonomies/${taxonomy}`, formats the response as JSON, and returns it in the tool's content structure.handler: async (args, context) => { validateRequired(args, ['taxonomy']); const taxonomy = await context.wpRequest(`/wp/v2/taxonomies/${args.taxonomy}`); return { content: [{ type: 'text', text: context.clampText(JSON.stringify(taxonomy, null, 2)) }], }; },
- src/tools/taxonomy/index.ts:563-569 (schema)The input schema for the 'wpnav_get_taxonomy' tool, defining a required 'taxonomy' string property.inputSchema: { type: 'object', properties: { taxonomy: { type: 'string', description: 'Taxonomy name (e.g., "category", "post_tag", or custom taxonomy)' }, }, required: ['taxonomy'], },
- src/tools/taxonomy/index.ts:559-582 (registration)The toolRegistry.register call that defines and registers the 'wpnav_get_taxonomy' tool, including its name, description, input schema, handler function, and category.toolRegistry.register({ definition: { name: 'wpnav_get_taxonomy', description: 'Get details about a specific taxonomy by name. Returns full taxonomy configuration including hierarchical status, REST base, and labels. Always available for site structure discovery.', inputSchema: { type: 'object', properties: { taxonomy: { type: 'string', description: 'Taxonomy name (e.g., "category", "post_tag", or custom taxonomy)' }, }, required: ['taxonomy'], }, }, handler: async (args, context) => { validateRequired(args, ['taxonomy']); const taxonomy = await context.wpRequest(`/wp/v2/taxonomies/${args.taxonomy}`); return { content: [{ type: 'text', text: context.clampText(JSON.stringify(taxonomy, null, 2)) }], }; }, category: ToolCategory.TAXONOMY, }); }