Skip to main content
Glama

wp_get_user

Retrieve a WordPress user by their unique ID to access profile information, manage permissions, or verify account details for site administration tasks.

Instructions

Retrieves a single user by their 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 user.

Implementation Reference

  • The handler function that executes the wp_get_user tool logic: extracts user ID, fetches user data from WordPressClient, formats details (name, username, email, roles), and returns formatted string or throws error.
    public async handleGetUser(client: WordPressClient, params: Record<string, unknown>): Promise<unknown> {
      const { id } = params as { id: number };
      try {
        const user = await client.getUser(id);
        const content =
          `**User Details (ID: ${user.id})**\n\n` +
          `- **Name:** ${user.name}\n` +
          `- **Username:** ${user.slug}\n` +
          `- **Email:** ${user.email}\n` +
          `- **Roles:** ${user.roles?.join(", ") || "N/A"}`;
        return content;
      } catch (_error) {
        throw new Error(`Failed to get user: ${getErrorMessage(_error)}`);
      }
    }
  • The tool registration within UserTools.getTools(): defines name, description, input parameters schema, and binds to the handleGetUser handler.
    {
      name: "wp_get_user",
      description: "Retrieves a single user by their ID.",
      parameters: [
        {
          name: "id",
          type: "number",
          required: true,
          description: "The unique identifier for the user.",
        },
      ],
      handler: this.handleGetUser.bind(this),
    },
  • Input schema definition for the wp_get_user tool: requires a numeric 'id' parameter.
    parameters: [
      {
        name: "id",
        type: "number",
        required: true,
        description: "The unique identifier for the user.",
      },
    ],
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 'retrieves' implies a read-only operation, it doesn't specify authentication requirements, rate limits, error responses, or what happens when the user ID doesn't exist. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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 states the core functionality without unnecessary words. It's front-loaded with the main action and resource, making it immediately understandable. Every word earns its place in this minimal but complete statement of purpose.

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?

For a simple retrieval tool with good schema coverage but no annotations or output schema, the description is adequate but has clear gaps. It covers the basic purpose but lacks behavioral context, usage guidance, and information about return values. Given the tool's relative simplicity among siblings, this represents a minimum viable description.

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 both parameters thoroughly. The description adds no additional parameter information beyond what's in the schema. It mentions 'by their ID' which aligns with the 'id' parameter but provides no extra context about parameter relationships or usage examples.

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 user'), making the purpose immediately understandable. It specifies retrieval by ID, which distinguishes it from list operations like wp_list_users. However, it doesn't explicitly differentiate from wp_get_current_user which also retrieves user data but without requiring an ID parameter.

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 wp_list_users for listing multiple users, wp_get_current_user for getting the authenticated user, or wp_update_user for modifying user data. There's no context about prerequisites, authentication requirements, or error conditions.

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