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

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,
                },
            },
        },

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