Skip to main content
Glama

wp_get_comment

Retrieve a specific WordPress comment by its unique ID to access comment details, moderate content, or analyze user feedback. Use this tool to fetch individual comments from your WordPress site for review or management purposes.

Instructions

Retrieves a single comment by its ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteNoThe ID of the WordPress site to target (from mcp-wordpress.config.json). Required if multiple sites are configured.
idYesThe unique identifier for the comment.

Implementation Reference

  • Tool registration definition in CommentTools.getTools() method, including name, description, input parameters schema, and binding to the handler function.
    {
      name: "wp_get_comment",
      description: "Retrieves a single comment by its ID.",
      parameters: [
        {
          name: "id",
          type: "number",
          required: true,
          description: "The unique identifier for the comment.",
        },
      ],
      handler: this.handleGetComment.bind(this),
    },
  • The main handler function that implements the wp_get_comment tool logic: extracts comment ID, fetches comment via WordPressClient, formats details, and returns formatted string or throws error.
    public async handleGetComment(client: WordPressClient, params: Record<string, unknown>): Promise<unknown> {
      try {
        const { id } = params as { id: number };
        const comment = await client.getComment(id);
        const content =
          `**Comment Details (ID: ${comment.id})**\n\n` +
          `- **Author:** ${comment.author_name}\n` +
          `- **Post ID:** ${comment.post}\n` +
          `- **Date:** ${new Date(comment.date).toLocaleString()}\n` +
          `- **Status:** ${comment.status}\n` +
          `- **Content:** ${comment.content.rendered}`;
        return content;
      } catch (_error) {
        throw new Error(`Failed to get comment: ${getErrorMessage(_error)}`);
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states it 'retrieves' (implying read-only), but doesn't clarify authentication requirements, rate limits, error handling (e.g., what happens if ID doesn't exist), or response format. For a read operation with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves beyond its basic function.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with zero wasted words. It's front-loaded with the core action and resource, making it immediately understandable. Every word earns its place by conveying essential information without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (simple retrieval), high schema coverage (100%), and lack of output schema, the description is minimally adequate. It covers the basic 'what' but misses behavioral context (especially with no annotations) and usage guidance. For a read operation in a crowded sibling set, more context would help the agent use it appropriately.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with both parameters (site and id) well-documented in the schema. The description adds no additional parameter semantics beyond what the schema already provides—it doesn't explain ID format, site configuration details, or parameter interactions. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Retrieves') and resource ('a single comment by its ID'), making the purpose specific and unambiguous. It distinguishes from sibling tools like wp_list_comments (which lists multiple comments) and wp_create_comment (which creates comments). However, it doesn't explicitly mention the WordPress context or differentiate from other 'get' tools like wp_get_post.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose wp_get_comment over wp_list_comments for single vs. multiple comments, or when to use it in relation to wp_update_comment or wp_delete_comment. There's no context about prerequisites, error conditions, or typical workflows.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/docdyhr/mcp-wordpress'

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