Skip to main content
Glama

wpnav_get_category

Retrieve detailed WordPress category information by ID, including description and post count, for content management and organization.

Instructions

Get a single WordPress category by ID. Returns full category details including description and post count.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesWordPress category ID

Implementation Reference

  • The handler function validates the category ID input, fetches the category details from the WordPress REST API endpoint `/wp/v2/categories/{id}`, and returns the JSON response as text content.
    handler: async (args, context) => { validateRequired(args, ['id']); const id = validateId(args.id, 'Category'); const category = await context.wpRequest(`/wp/v2/categories/${id}`); return { content: [{ type: 'text', text: context.clampText(JSON.stringify(category, null, 2)) }], }; },
  • The tool registration within registerTaxonomyTools() function, including name, description, input schema requiring 'id' (number), handler, and ToolCategory.TAXONOMY.
    toolRegistry.register({ definition: { name: 'wpnav_get_category', description: 'Get a single WordPress category by ID. Returns full category details including description and post count.', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'WordPress category ID' }, }, required: ['id'], }, }, handler: async (args, context) => { validateRequired(args, ['id']); const id = validateId(args.id, 'Category'); const category = await context.wpRequest(`/wp/v2/categories/${id}`); return { content: [{ type: 'text', text: context.clampText(JSON.stringify(category, null, 2)) }], }; }, category: ToolCategory.TAXONOMY, });
  • Static tool schema definition listed in the exported tools array for client discovery or documentation purposes.
    { name: 'wpnav_get_category', description: 'Get a single WordPress category by ID. Returns full category details including description and post count.', inputSchema: { type: 'object' as const, properties: { id: { type: 'number' as const, description: 'WordPress category ID', }, }, required: ['id'], },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/littlebearapps/wp-navigator-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server