Skip to main content
Glama
Leonelberio

WordPress MCP Server

by Leonelberio

get_posts

Retrieve WordPress posts by specifying site URL, credentials, and pagination parameters. Use this tool to fetch post data efficiently via the WordPress MCP Server's REST API.

Instructions

Get WordPress posts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number
passwordNoWordPress password (overrides WORDPRESS_PASSWORD env var)
perPageNoNumber of posts per page
siteUrlNoWordPress site URL (overrides WORDPRESS_SITE_URL env var)
usernameNoWordPress username (overrides WORDPRESS_USERNAME env var)

Implementation Reference

  • The handler implementation for the 'get_posts' tool. It makes an axios GET request to the WordPress REST API /posts endpoint with optional pagination parameters (per_page and page), and returns the response data.
    case 'get_posts':
      const getResponse = await client.get('/posts', {
        params: {
          per_page: params.perPage || 10,
          page: params.page || 1,
        },
      });
      return getResponse.data;
  • src/index.ts:95-125 (registration)
    The registration of the 'get_posts' tool in the ListTools response, including its name, description, and input schema definition.
    {
      name: 'get_posts',
      description: 'Get WordPress posts',
      inputSchema: {
        type: 'object',
        properties: {
          siteUrl: {
            type: 'string',
            description: 'WordPress site URL (overrides WORDPRESS_SITE_URL env var)',
          },
          username: {
            type: 'string',
            description: 'WordPress username (overrides WORDPRESS_USERNAME env var)',
          },
          password: {
            type: 'string',
            description: 'WordPress password (overrides WORDPRESS_PASSWORD env var)',
          },
          perPage: {
            type: 'number',
            description: 'Number of posts per page',
            default: 10,
          },
          page: {
            type: 'number',
            description: 'Page number',
            default: 1,
          },
        },
      },
    },
  • The input schema definition for the 'get_posts' tool, specifying properties for site credentials and pagination.
    inputSchema: {
      type: 'object',
      properties: {
        siteUrl: {
          type: 'string',
          description: 'WordPress site URL (overrides WORDPRESS_SITE_URL env var)',
        },
        username: {
          type: 'string',
          description: 'WordPress username (overrides WORDPRESS_USERNAME env var)',
        },
        password: {
          type: 'string',
          description: 'WordPress password (overrides WORDPRESS_PASSWORD env var)',
        },
        perPage: {
          type: 'number',
          description: 'Number of posts per page',
          default: 10,
        },
        page: {
          type: 'number',
          description: 'Page number',
          default: 1,
        },
      },
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Get WordPress posts' implies a read operation, but it doesn't specify whether this requires authentication, how it handles pagination, what the return format is, or any rate limits. The description is too minimal to provide meaningful behavioral context beyond the basic action.

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 'Get WordPress posts' is extremely concise—just three words—and front-loaded with the core action. There is no wasted language or unnecessary elaboration, making it efficient for quick understanding. It earns a high score for brevity and directness.

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 the tool's complexity (5 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what the tool returns, how authentication works (implied by parameters but not stated), or any behavioral traits. With no output schema and minimal description, it fails to provide enough context for effective use by an AI agent.

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?

The input schema has 100% description coverage, with clear documentation for all 5 parameters (e.g., 'page', 'perPage', 'siteUrl'). The description adds no additional meaning beyond what the schema provides, such as explaining parameter interactions or usage examples. According to the rules, with high schema coverage (>80%), the baseline score is 3, as the schema does the heavy lifting.

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

Purpose3/5

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

The description 'Get WordPress posts' clearly states the verb ('Get') and resource ('WordPress posts'), making the basic purpose understandable. However, it lacks specificity about what 'Get' entails (e.g., listing, retrieving, filtering) and doesn't distinguish it from sibling tools like 'create_post' or 'update_post', which are clearly different operations. This makes it vague but not tautological.

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 any context, prerequisites, or exclusions, such as when to use it over other post-related tools or under what conditions it's appropriate. This leaves the agent without usage direction beyond the basic purpose.

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

Related 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/Leonelberio/the-wordpress-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server