wpnav_get_comment
Retrieve detailed WordPress comment information by ID, including author data and content, for management and moderation tasks.
Instructions
Get a single comment by ID. Returns full comment details including author info and content.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | WordPress comment ID |
Implementation Reference
- src/tools/content/index.ts:912-926 (handler)The handler function for wpnav_get_comment: validates input, fetches comment via WP REST API, extracts key fields into summary, and returns formatted JSON response.handler: async (args, context) => { validateRequired(args, ['id']); const id = validateId(args.id, 'Comment'); const comment = await context.wpRequest(`/wp/v2/comments/${id}`); const summary = extractSummary(comment, [ 'id', 'author_name', 'author_email', 'author_url', 'content.rendered', 'status', 'post', 'parent', 'date', ]); return { content: [{ type: 'text', text: context.clampText(JSON.stringify(summary, null, 2)) }], }; },
- src/tools/content/index.ts:901-928 (registration)Registers the wpnav_get_comment tool with toolRegistry, including schema definition and inline handler implementation.definition: { name: 'wpnav_get_comment', description: 'Get a single comment by ID. Returns full comment details including author info and content.', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'WordPress comment ID' }, }, required: ['id'], }, }, handler: async (args, context) => { validateRequired(args, ['id']); const id = validateId(args.id, 'Comment'); const comment = await context.wpRequest(`/wp/v2/comments/${id}`); const summary = extractSummary(comment, [ 'id', 'author_name', 'author_email', 'author_url', 'content.rendered', 'status', 'post', 'parent', 'date', ]); return { content: [{ type: 'text', text: context.clampText(JSON.stringify(summary, null, 2)) }], }; }, category: ToolCategory.CONTENT, });
- src/tools.ts:404-418 (schema)Static schema definition for wpnav_get_comment tool, likely used for MCP tool discovery and validation.{ name: 'wpnav_get_comment', description: 'Get a single comment by ID. Returns full comment details including author info and content.', inputSchema: { type: 'object' as const, properties: { id: { type: 'number' as const, description: 'WordPress comment ID', }, }, required: ['id'], }, },