Skip to main content
Glama

wp_create_comment

Add a comment to a WordPress post by specifying the post ID, comment content, and optional author details to facilitate user engagement and feedback.

Instructions

Creates a new comment on a post.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteNoThe ID of the WordPress site to target (from mcp-wordpress.config.json). Required if multiple sites are configured.
postYesThe ID of the post to comment on.
contentYesThe content of the comment.
author_nameNoThe name of the comment author.
author_emailNoThe email of the comment author.

Implementation Reference

  • MCP tool registration for 'wp_create_comment', including name, description, input schema (parameters), and handler reference.
    {
      name: "wp_create_comment",
      description: "Creates a new comment on a post.",
      parameters: [
        {
          name: "post",
          type: "number",
          required: true,
          description: "The ID of the post to comment on.",
        },
        {
          name: "content",
          type: "string",
          required: true,
          description: "The content of the comment.",
        },
        {
          name: "author_name",
          type: "string",
          description: "The name of the comment author.",
        },
        {
          name: "author_email",
          type: "string",
          description: "The email of the comment author.",
        },
      ],
      handler: this.handleCreateComment.bind(this),
    },
  • The core handler function for the 'wp_create_comment' tool. It casts input parameters to CreateCommentRequest, calls the WordPressClient's createComment method, and returns a success message with the new comment ID or throws a formatted error.
    public async handleCreateComment(client: WordPressClient, params: Record<string, unknown>): Promise<unknown> {
      const createParams = params as unknown as CreateCommentRequest;
      try {
        const comment = await client.createComment(createParams);
        return `✅ Comment created successfully with ID: ${comment.id}`;
      } catch (_error) {
        throw new Error(`Failed to create 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 this is a creation operation but doesn't mention authentication requirements, rate limits, whether the comment appears immediately or needs approval, or what happens on success/failure. For a write operation with zero annotation coverage, this is insufficient.

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, focused sentence with zero wasted words. It's perfectly front-loaded with the core action and target, making it immediately understandable without any unnecessary elaboration.

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 write operation (comment creation) with no annotations and no output schema, the description is incomplete. It doesn't address authentication needs, success/failure behavior, moderation status, or return values. Given the complexity of creating user-generated content in WordPress, more context is needed.

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 documents all 5 parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema descriptions, so it meets the baseline expectation but doesn't provide extra value.

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 ('creates a new comment') and the target resource ('on a post'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like wp_update_comment or wp_approve_comment, which would be needed for a perfect score.

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 like wp_update_comment for modifying existing comments or wp_approve_comment for moderation actions. There's no mention of prerequisites, constraints, or typical use cases.

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