Skip to main content
Glama

wp_list_comments

Retrieve and filter comments from a WordPress site, including options to limit results by post ID or comment status.

Instructions

Lists comments from a WordPress site, with filters.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteNoThe ID of the WordPress site to target (from mcp-wordpress.config.json). Required if multiple sites are configured.
postNoLimit results to comments assigned to a specific post ID.
statusNoFilter by comment status.

Implementation Reference

  • Tool registration including name, description, input schema (parameters), and handler binding.
    {
      name: "wp_list_comments",
      description: "Lists comments from a WordPress site, with filters.",
      parameters: [
        {
          name: "post",
          type: "number",
          description: "Limit results to comments assigned to a specific post ID.",
        },
        {
          name: "status",
          type: "string",
          description: "Filter by comment status.",
          enum: ["hold", "approve", "spam", "trash"],
        },
      ],
      handler: this.handleListComments.bind(this),
    },
  • Executes the tool logic: fetches comments via WordPressClient.getComments, formats a markdown list if found, or empty message; throws formatted error.
    public async handleListComments(client: WordPressClient, params: Record<string, unknown>): Promise<unknown> {
      const queryParams = params as CommentQueryParams;
      try {
        const comments = await client.getComments(queryParams);
        if (comments.length === 0) {
          return "No comments found matching the criteria.";
        }
        const content =
          `Found ${comments.length} comments:\n\n` +
          comments
            .map(
              (c) =>
                `- ID ${c.id}: By **${c.author_name}** on Post ${c.post} (${
                  c.status
                })\n  > ${c.content.rendered.substring(0, 100)}...`,
            )
            .join("\n");
        return content;
      } catch (_error) {
        throw new Error(`Failed to list comments: ${getErrorMessage(_error)}`);
      }
    }
  • Input parameter schema definition for post ID filter (optional number) and status filter (optional enum).
    parameters: [
      {
        name: "post",
        type: "number",
        description: "Limit results to comments assigned to a specific post ID.",
      },
      {
        name: "status",
        type: "string",
        description: "Filter by comment status.",
        enum: ["hold", "approve", "spam", "trash"],
      },
    ],
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions 'with filters' but doesn't disclose key behavioral traits such as pagination, rate limits, authentication requirements, or what happens if no filters are applied (e.g., returns all comments). For a list operation with no annotation coverage, this leaves significant gaps in understanding how the tool behaves.

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, efficient sentence that front-loads the core purpose ('Lists comments from a WordPress site') and adds a useful qualifier ('with filters'). There is zero waste or redundancy, making it appropriately sized for its function.

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 moderate complexity (list operation with filters), no annotations, and no output schema, the description is minimally adequate. It states what the tool does but lacks details on behavior, output format, or error handling. For a tool with 3 parameters and no structured safety hints, it should provide more context to be fully complete.

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%, meaning the input schema already documents all three parameters (site, post, status) with clear descriptions. The description adds no additional meaning beyond implying filtering exists, which is already covered by the schema. Baseline 3 is appropriate when the schema does the heavy lifting, but no extra value is added.

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 verb ('Lists') and resource ('comments from a WordPress site'), and specifies the action includes filters. It distinguishes itself from siblings like wp_get_comment (which retrieves a single comment) and wp_create_comment (which creates comments). However, it doesn't explicitly differentiate from wp_approve_comment or wp_spam_comment, which are also comment-related but perform different actions.

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

Usage Guidelines3/5

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

The description implies usage context through 'with filters,' suggesting it's for retrieving multiple comments with optional filtering. However, it lacks explicit guidance on when to use this tool versus alternatives like wp_get_comment (for single comments) or wp_search_site (for broader searches). No exclusions or prerequisites are mentioned, leaving usage somewhat open-ended.

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