Skip to main content
Glama

wp_test_auth

Test WordPress site authentication and connectivity with detailed diagnostics to verify credentials, troubleshoot connection issues, and ensure proper setup.

Instructions

Tests the authentication and connectivity for a configured WordPress site with detailed connection diagnostics.

Usage Examples: • Test connection: wp_test_auth • Multi-site test: wp_test_auth --site="my-site" • Verify setup: Use this after configuring new credentials • Troubleshoot: Run when experiencing connection issues • Health check: Regular verification of WordPress connectivity

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteNoThe ID of the WordPress site to target (from mcp-wordpress.config.json). Required if multiple sites are configured.

Implementation Reference

  • The handleTestAuth function implements the core logic of the wp_test_auth tool: pings the WordPress site, retrieves the current user, formats a success message with site, method, user, and roles details, or throws an error on failure.
    public async handleTestAuth(
      client: WordPressClient,
      params: Record<string, unknown>,
    ): Promise<Record<string, unknown>> {
      try {
        await client.ping();
        const user = await client.getCurrentUser();
        const siteConfig = client.config;
    
        const content =
          "✅ **Authentication successful!**\n\n" +
          `**Site:** ${siteConfig.baseUrl}\n` +
          `**Method:** ${siteConfig.auth.method}\n` +
          `**User:** ${user.name} (@${user.slug})\n` +
          `**Roles:** ${user.roles?.join(", ") || "N/A"}\n\n` +
          "Your WordPress connection is working properly.";
    
        return { content };
      } catch (_error) {
        throw new Error(`Authentication test failed: ${getErrorMessage(_error)}`);
      }
    }
  • The tool definition object in AuthTools.getTools() that registers wp_test_auth with its name, detailed description, empty parameters (site added dynamically), and binds the handler.
      name: "wp_test_auth",
      description:
        "Tests the authentication and connectivity for a configured WordPress site with detailed connection diagnostics.\n\n" +
        "**Usage Examples:**\n" +
        "• Test connection: `wp_test_auth`\n" +
        '• Multi-site test: `wp_test_auth --site="my-site"`\n' +
        "• Verify setup: Use this after configuring new credentials\n" +
        "• Troubleshoot: Run when experiencing connection issues\n" +
        "• Health check: Regular verification of WordPress connectivity",
      parameters: [], // The 'site' parameter is added dynamically by the server
      handler: this.handleTestAuth.bind(this),
    },
  • Tool schema definition including name, description, and parameters array (empty, as 'site' parameter is dynamically added by ToolRegistry).
      name: "wp_test_auth",
      description:
        "Tests the authentication and connectivity for a configured WordPress site with detailed connection diagnostics.\n\n" +
        "**Usage Examples:**\n" +
        "• Test connection: `wp_test_auth`\n" +
        '• Multi-site test: `wp_test_auth --site="my-site"`\n' +
        "• Verify setup: Use this after configuring new credentials\n" +
        "• Troubleshoot: Run when experiencing connection issues\n" +
        "• Health check: Regular verification of WordPress connectivity",
      parameters: [], // The 'site' parameter is added dynamically by the server
      handler: this.handleTestAuth.bind(this),
    },
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'detailed connection diagnostics' which hints at what the tool returns, but doesn't specify the format, whether it's read-only, what permissions are required, or any rate limits. The description adequately conveys it's a diagnostic/testing tool but lacks comprehensive behavioral details.

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 well-structured and appropriately sized. It starts with a clear purpose statement, then provides organized usage examples in bullet points. Every sentence earns its place by offering specific guidance without redundancy. The bullet points are front-loaded with the most common use cases.

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

Completeness4/5

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

For a diagnostic tool with one parameter (100% schema coverage) and no output schema, the description provides good contextual completeness. It explains the tool's purpose, when to use it, and includes practical examples. However, without annotations or output schema, it could benefit from more detail about what the diagnostics actually return.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 100% description coverage for its single parameter, so the baseline is 3. The description adds value by providing usage examples that show when the 'site' parameter is needed ('Multi-site test: wp_test_auth --site="my-site"') and clarifying it's required for multi-site configurations, which enhances understanding beyond the schema's technical description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Tests the authentication and connectivity for a configured WordPress site with detailed connection diagnostics.' It uses specific verbs ('tests', 'diagnostics') and distinguishes itself from siblings like wp_get_auth_status by emphasizing testing and diagnostics rather than just retrieving status.

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

Usage Guidelines5/5

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

The description provides explicit usage guidelines with five bullet points covering when to use this tool: after configuring new credentials, when experiencing connection issues, for regular health checks, and with examples for single-site and multi-site testing. It clearly differentiates from other tools by focusing on authentication testing rather than content management or performance monitoring.

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