Skip to main content
Glama
gaupoit

WordPress MCP Server

by gaupoit

wp_get_pages

Retrieve pages from WordPress sites with options to filter by search terms and control result quantity for content management and navigation.

Instructions

Get pages from WordPress.

Args:
    per_page: Number of pages to return (1-100). Default is 10.
    search: Search term to filter pages by title/content.

Returns:
    List of pages with id, title, status, slug, and link.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
per_pageNo
searchNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler and registration for 'wp_get_pages'. This function defines the tool schema via type hints and docstring, and executes by delegating to WordPressClient.get_pages().
    @mcp.tool()
    def wp_get_pages(
        per_page: int = 10,
        search: str | None = None,
    ) -> list[dict]:
        """Get pages from WordPress.
    
        Args:
            per_page: Number of pages to return (1-100). Default is 10.
            search: Search term to filter pages by title/content.
    
        Returns:
            List of pages with id, title, status, slug, and link.
        """
        client = get_client()
        return client.get_pages(per_page=per_page, search=search)
  • Supporting method in WordPressClient that performs the actual API call to /wp/v2/pages, handles parameters, and formats the response data.
    def get_pages(
        self,
        per_page: int = 10,
        search: str | None = None,
    ) -> list[dict]:
        """Get pages from WordPress."""
        params = {"per_page": per_page}
    
        if search:
            params["search"] = search
    
        pages = self._get("pages", params)
    
        return [
            {
                "id": p["id"],
                "title": p["title"]["rendered"],
                "status": p["status"],
                "slug": p["slug"],
                "link": p["link"],
            }
            for p in pages
        ]
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 describes the return format ('List of pages with id, title, status, slug, and link'), which is helpful, but doesn't mention important behavioral aspects like authentication requirements, rate limits, pagination behavior beyond the per_page parameter, or whether this is a read-only operation (though 'Get' implies it).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (Args, Returns) and uses minimal space effectively. Every sentence adds value, though the initial 'Get pages from WordPress.' could be slightly more informative about scope or limitations.

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?

Given the tool's moderate complexity (2 parameters, no annotations, but has output schema), the description is reasonably complete. It explains parameters well and describes the return format. The output schema existence means it doesn't need to fully document return values, though it could benefit from mentioning authentication or error handling.

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

Parameters5/5

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

The description provides excellent parameter semantics that go well beyond the input schema. The schema has 0% description coverage, but the description explains both parameters thoroughly: 'per_page: Number of pages to return (1-100). Default is 10.' and 'search: Search term to filter pages by title/content.' This fully compensates for the schema's lack of documentation.

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 ('Get pages') and resource ('from WordPress'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like wp_get_posts or wp_get_post, which reduces it from 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_get_posts or wp_get_post. It mentions what the tool does but offers no context about appropriate use cases or exclusions.

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/gaupoit/wordpress-mcp'

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