wpnav_get_theme
Retrieve detailed metadata for a specific WordPress theme, including description, author, and version, by providing its stylesheet slug.
Instructions
Get details about a specific theme by slug. Returns full metadata including description, author, and version.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stylesheet | Yes | Theme stylesheet from wpnav_list_themes "stylesheet" field (e.g., "twentytwentyfour") |
Implementation Reference
- src/tools/themes/index.ts:67-75 (handler)The handler function for the wpnav_get_theme tool. It validates the input, makes a WP REST API request to /wp/v2/themes/{stylesheet}, and returns the theme details as JSON text.handler: async (args, context) => { validateRequired(args, ['stylesheet']); const theme = await context.wpRequest(`/wp/v2/themes/${args.stylesheet}`); return { content: [{ type: 'text', text: context.clampText(JSON.stringify(theme, null, 2)) }], }; },
- src/tools/themes/index.ts:59-65 (schema)Input schema for wpnav_get_theme tool, requiring a 'stylesheet' string parameter.inputSchema: { type: 'object', properties: { stylesheet: { type: 'string', description: 'Theme stylesheet from wpnav_list_themes "stylesheet" field (e.g., "twentytwentyfour")' }, }, required: ['stylesheet'], },
- src/tools/themes/index.ts:55-77 (registration)Full registration of the wpnav_get_theme tool via toolRegistry.register, including definition (name, description, schema), handler, and category.toolRegistry.register({ definition: { name: 'wpnav_get_theme', description: 'Get details about a specific theme by slug. Returns full metadata including description, author, and version.', inputSchema: { type: 'object', properties: { stylesheet: { type: 'string', description: 'Theme stylesheet from wpnav_list_themes "stylesheet" field (e.g., "twentytwentyfour")' }, }, required: ['stylesheet'], }, }, handler: async (args, context) => { validateRequired(args, ['stylesheet']); const theme = await context.wpRequest(`/wp/v2/themes/${args.stylesheet}`); return { content: [{ type: 'text', text: context.clampText(JSON.stringify(theme, null, 2)) }], }; }, category: ToolCategory.THEMES, });