Skip to main content
Glama

wp_spam_comment

Mark WordPress comments as spam to manage unwanted content and maintain site integrity using the MCP WordPress Server.

Instructions

Marks a comment as spam.

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 ID of the comment to mark as spam.

Implementation Reference

  • The handler function for wp_spam_comment, which updates the comment status to 'spam' using the WordPress client.
    public async handleSpamComment(client: WordPressClient, params: Record<string, unknown>): Promise<unknown> {
      const { id } = params as { id: number };
      try {
        const comment = await client.updateComment({
          id,
          status: "spam",
        });
        return `✅ Comment ${comment.id} has been marked as spam.`;
      } catch (_error) {
        throw new Error(`Failed to mark comment as spam: ${getErrorMessage(_error)}`);
      }
    }
  • The registration of the wp_spam_comment tool in the CommentTools.getTools() array, including schema (parameters) and handler binding.
    {
      name: "wp_spam_comment",
      description: "Marks a comment as spam.",
      parameters: [
        {
          name: "id",
          type: "number",
          required: true,
          description: "The ID of the comment to mark as spam.",
        },
      ],
      handler: this.handleSpamComment.bind(this),
    },
  • Input schema for wp_spam_comment tool: requires 'id' as number.
    parameters: [
      {
        name: "id",
        type: "number",
        required: true,
        description: "The ID of the comment to mark as spam.",
      },
    ],
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. While 'marks as spam' implies a mutation (changing comment status), it doesn't disclose whether this requires admin permissions, whether the action is reversible, what happens to the comment after marking (e.g., moved to spam folder vs deleted), or any rate limits. For a mutation tool with zero annotation coverage, this is a significant gap in behavioral context.

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 in conveying the essential purpose.

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

Completeness2/5

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

For a mutation tool with no annotations and no output schema, the description is insufficiently complete. It doesn't address what happens after marking as spam, whether there are permission requirements, what the response looks like, or how this differs from other comment management tools. Given the complexity of a write operation and the rich sibling toolset, more context is needed for the agent to use this tool effectively.

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%, so the schema already fully documents both parameters (site and id). The description doesn't add any parameter semantics beyond what's in the schema - it doesn't explain comment ID format, site ID requirements, or provide examples. With complete schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't need to.

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 ('marks as spam') and resource ('a comment'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like wp_approve_comment or wp_delete_comment, which would require a 5, but the verb 'marks as spam' is specific enough to indicate this is a moderation action rather than deletion or approval.

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?

No guidance is provided about when to use this tool versus alternatives like wp_delete_comment or wp_approve_comment. The description doesn't mention prerequisites, consequences, or typical scenarios for marking comments as spam versus other actions. This leaves the agent without context for choosing between sibling comment management tools.

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