Skip to main content
Glama

confluence_list_pages

Retrieve and display pages from a Confluence space to access documentation and content. Specify space key and limit to filter results.

Instructions

List pages in a Confluence space.

Args: space_key: Space key (optional, defaults to CONFLUENCE_SPACE_KEY env var) limit: Maximum number of pages to return (default: 25)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
space_keyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for 'confluence_list_pages'. Registers the tool using @mcp.tool() decorator and delegates execution to ConfluenceTools.list_pages() method.
    @mcp.tool()
    async def confluence_list_pages(
        space_key: Optional[str] = None, limit: int = 25
    ) -> list:
        """List pages in a Confluence space.
    
        Args:
            space_key: Space key (optional, defaults to CONFLUENCE_SPACE_KEY env var)
            limit: Maximum number of pages to return (default: 25)
        """
        return await confluence_tools.list_pages(space_key=space_key, limit=limit)
  • Core helper method implementing the logic to list pages in a Confluence space using the Atlassian Confluence Python client library. Called by the MCP handler.
    async def list_pages(
        self,
        space_key: Optional[str] = None,
        limit: int = 25,
        expand: Optional[str] = None,
    ) -> List[Dict[str, Any]]:
        """
        List pages in a Confluence space.
    
        Args:
            space_key: Space key (defaults to CONFLUENCE_SPACE_KEY env var)
            limit: Maximum number of pages to return
            expand: Optional expand parameters (e.g., "body.storage,version")
    
        Returns:
            List of page information
        """
        self._check_client()
    
        try:
            space_key = space_key or Config.CONFLUENCE_SPACE_KEY
            if not space_key:
                raise ValueError("Space key is required")
    
            pages = self.client.get_all_pages_from_space(
                space=space_key,
                start=0,
                limit=limit,
                expand=expand,
            )
    
            results = []
            for page in pages:
                page_data = {
                    "id": page.get("id"),
                    "title": page.get("title"),
                    "type": page.get("type"),
                    "status": page.get("status"),
                }
    
                # Add URL
                if "_links" in page and "webui" in page["_links"]:
                    page_data["url"] = (
                        f"{Config.CONFLUENCE_URL}{page['_links']['webui']}"
                    )
    
                # Add version if available
                if "version" in page:
                    page_data["version"] = page["version"].get("number")
    
                # Add space info
                if "space" in page:
                    page_data["space"] = {
                        "key": page["space"].get("key"),
                        "name": page["space"].get("name"),
                    }
    
                results.append(page_data)
    
            return results
    
        except Exception as e:
            logger.error(f"Confluence API error: {e}")
            raise ValueError(f"Failed to list pages: {str(e)}")
  • Explicit JSON schema definition for the 'confluence_list_pages' tool input, used in the LLM assistant for tool calling with Anthropic Claude.
    {
        "name": "confluence_list_pages",
        "description": "List pages in a Confluence space",
        "input_schema": {
            "type": "object",
            "properties": {
                "space_key": {"type": "string", "description": "Space key"},
                "limit": {
                    "type": "integer",
                    "description": "Maximum pages",
                    "default": 25,
                },
            },
        },
Behavior2/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 states it's a list operation, implying read-only behavior, but doesn't mention authentication requirements, rate limits, pagination details, or what the output looks like (though an output schema exists). 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.

Conciseness4/5

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

The description is appropriately sized and front-loaded: the first sentence states the core purpose, followed by a brief parameter section. There's no wasted text, though the structure could be slightly improved by integrating parameter details more seamlessly rather than a separate 'Args:' section.

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?

Given the tool's low complexity (2 optional parameters) and the presence of an output schema (which handles return values), the description is minimally adequate. However, with no annotations and 0% schema coverage, it should do more to explain behavioral aspects like authentication or usage context, making it incomplete for optimal agent guidance.

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 description adds some parameter semantics: it explains that 'space_key' is optional and defaults to an environment variable, and 'limit' has a default of 25. However, with 0% schema description coverage, it doesn't fully compensate—it doesn't clarify what a 'space_key' is, format requirements, or valid ranges for 'limit'. The baseline is 3 since it adds value but not enough to cover the schema gap.

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 verb ('List') and resource ('pages in a Confluence space'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'confluence_list_spaces' (which lists spaces rather than pages) or 'confluence_search_pages' (which might offer filtering capabilities), missing full sibling differentiation for 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. It doesn't mention sibling tools like 'confluence_search_pages' for filtered searches or 'confluence_list_spaces' for listing spaces instead of pages, nor does it specify prerequisites or exclusions, leaving usage context unclear.

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/bsangars/mcp'

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