Skip to main content
Glama

wp_delete_user

Remove a user from a WordPress site, optionally reassigning their content to another user account for continuity.

Instructions

Deletes a user.

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 user to delete.
reassignNoThe ID of a user to reassign the deleted user's content to.

Implementation Reference

  • Registers the wp_delete_user tool within the UserTools.getTools() array, including name, description, parameters schema, and handler binding.
    {
      name: "wp_delete_user",
      description: "Deletes a user.",
      parameters: [
        {
          name: "id",
          type: "number",
          required: true,
          description: "The ID of the user to delete.",
        },
        {
          name: "reassign",
          type: "number",
          description: "The ID of a user to reassign the deleted user's content to.",
        },
      ],
      handler: this.handleDeleteUser.bind(this),
    },
  • Implements the core logic for wp_delete_user: destructures id and optional reassign from params, calls WordPressClient.deleteUser, constructs success message (with reassign info if provided), handles errors.
    public async handleDeleteUser(client: WordPressClient, params: Record<string, unknown>): Promise<unknown> {
      const { id, reassign } = params as { id: number; reassign?: number };
      try {
        await client.deleteUser(id, reassign);
        let content = `✅ User ${id} has been deleted.`;
        if (reassign) {
          content += ` Their content has been reassigned to user ID ${reassign}.`;
        }
        return content;
      } catch (_error) {
        throw new Error(`Failed to delete user: ${getErrorMessage(_error)}`);
      }
    }
  • Input schema definition for wp_delete_user tool: requires 'id' (number, user ID to delete), optional 'reassign' (number, ID for reassigning deleted user's content). Defines MCP tool parameters.
    parameters: [
      {
        name: "id",
        type: "number",
        required: true,
        description: "The ID of the user to delete.",
      },
      {
        name: "reassign",
        type: "number",
        description: "The ID of a user to reassign the deleted user's content to.",
      },
    ],
Behavior2/5

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

No annotations are provided, so the description carries full burden. 'Deletes a user' implies a destructive, irreversible mutation, but it doesn't disclose critical behavioral traits: whether deletion is permanent, what happens to user content (hinted by 'reassign' parameter but not explained), authentication requirements, error conditions, or rate limits. This is inadequate for a destructive tool with zero annotation coverage.

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 extremely concise—just three words—and front-loaded with the core action. There's zero wasted text, making it easy to parse quickly, though this conciseness comes at the cost of completeness in other dimensions.

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?

Given this is a destructive mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain the impact of deletion, what 'reassign' does in practice, potential side effects, or what the tool returns (e.g., success/failure). For such a high-stakes operation, more context is needed to use it safely and 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 fully documents all three parameters (site, id, reassign) with clear descriptions. The description adds no parameter information beyond what's in the schema, which is acceptable given the high coverage—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 verb ('Deletes') and resource ('a user'), making the purpose immediately understandable. However, it doesn't differentiate from sibling deletion tools like wp_delete_category, wp_delete_comment, etc., which all follow the same 'Deletes a [resource]' pattern, so it lacks sibling distinction.

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 prerequisites (e.g., user must exist), exclusions (e.g., cannot delete current user), or related tools like wp_get_user for verification or wp_update_user for modification instead of deletion.

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