Skip to main content
Glama

cwiki_list_pages

Retrieve a paginated list of pages from the Apache Incubator Confluence space, with an option to force refresh the cache.

Instructions

List pages in the configured Apache Incubator Confluence space.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
startNo
force_refreshNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the cwiki_list_pages tool. It is decorated with @mcp.tool(), validates limit/start parameters, calls client.confluence_get to fetch the Confluence API listing, and returns pagination metadata plus page summaries.
    @mcp.tool()
    def cwiki_list_pages(limit: int = 25, start: int = 0, force_refresh: bool = False) -> dict[str, Any]:
        """List pages in the configured Apache Incubator Confluence space."""
        validate_range("limit", limit, 1, 100)
        validate_range("start", start, 0, 1_000_000)
    
        pages = client.confluence_get(
            "/rest/api/content",
            {
                "spaceKey": client.SPACE_KEY,
                "type": "page",
                "status": "current",
                "limit": str(limit),
                "start": str(start),
                "expand": "version",
            },
            force_refresh=force_refresh,
        )
    
        return {
            **client.pagination(pages),
            "pages": [client.page_summary(page) for page in pages.get("results", [])],
        }
  • The confluence_get helper called by cwiki_list_pages; handles caching (read/write) and delegates to confluence_request for the actual HTTP call.
    def confluence_get(
        path: str,
        query: dict[str, str] | None = None,
        *,
        force_refresh: bool = False,
    ) -> dict[str, Any]:
        suffix = ""
        if query:
            suffix = "?" + urllib.parse.urlencode(query)
        request_path = f"{path}{suffix}"
    
        if not force_refresh:
            cached = cache.read_cache(request_path, BASE_URL, SPACE_KEY)
            if cached is not None:
                return cached
    
        response = confluence_request(request_path)
        cache.write_cache(request_path, response, BASE_URL, SPACE_KEY)
        return response
  • The page_summary helper used to transform each Confluence page result into a minimal summary dict (id, title, status, version, updated, updatedBy, url).
    def page_summary(page: dict[str, Any]) -> dict[str, Any]:
        version = page.get("version", {})
        history = page.get("history", {})
        last_updated = history.get("lastUpdated", {})
        links = page.get("_links", {})
        return {
            "id": page.get("id"),
            "title": page.get("title"),
            "status": page.get("status"),
            "version": version.get("number"),
            "updated": version.get("when") or last_updated.get("when"),
            "updatedBy": version.get("by", {}).get("displayName") or last_updated.get("by", {}).get("displayName"),
            "url": f"{BASE_URL}{links['webui']}" if links.get("webui") else None,
        }
  • The pagination helper that extracts pagination fields (start, limit, size, hasNext, next) from the Confluence API response.
    def pagination(result: dict[str, Any]) -> dict[str, Any]:
        links = result.get("_links", {})
        return {
            "start": result.get("start", 0),
            "limit": result.get("limit"),
            "size": result.get("size", len(result.get("results", []))),
            "hasNext": bool(links.get("next")),
            "next": f"{BASE_URL}{links['next']}" if links.get("next") else None,
        }
  • The validate_range helper used by cwiki_list_pages to enforce limit (1-100) and start (0-1,000,000) bounds.
    def validate_range(name: str, value: int, minimum: int, maximum: int) -> None:
        if value < minimum or value > maximum:
            raise ValueError(f"{name} must be between {minimum} and {maximum}")
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It states only 'List pages' and omits pagination behavior (despite start/limit parameters), whether archived or restricted pages are included, cache refresh effects, or any side effects. This is insufficient for an agent to understand the tool's behavior.

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

Conciseness3/5

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

The description is very short (one sentence) but lacks necessary context. While conciseness is positive, the brevity results in incompleteness. It could be improved by adding a second sentence on usage or behavior.

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 presence of an output schema and three parameters with no descriptions, the description should at least mention the output format (list of page objects) and pagination semantics. It does not, and the tool's complete behavior (e.g., whether it returns all pages or respects limits) is unclear.

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

Parameters1/5

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

Schema description coverage is 0%, so the description must explain the parameters. It mentions none of the three parameters (limit, start, force_refresh). The parameter titles are generic and their meanings (pagination control, cache bypass) are not communicated. This adds no value beyond the schema.

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 verb 'list' and the resource 'pages in the configured Apache Incubator Confluence space', unambiguously differentiating from siblings like cwiki_search_pages (which searches) and cwiki_get_page (which retrieves a single page).

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

Usage Guidelines3/5

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

The description implies usage for the single configured space but does not explicitly guide when to use this tool versus alternatives like cwiki_search_pages for filtered results or cwiki_get_children for hierarchical nav. No exclusions or conditions are mentioned.

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/justinmclean/CwikiMCP'

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