confluence_get_page_content
Retrieve content from a specific Confluence page using its page ID to access documentation and information stored in Confluence.
Instructions
Get content of a specific Confluence page.
Args: page_id: Page ID
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- mpo_mcp/server.py:124-132 (handler)MCP tool handler for 'confluence_get_page_content'. Decorated with @mcp.tool(), it delegates to ConfluenceTools.get_page_content.
@mcp.tool() async def confluence_get_page_content(page_id: str) -> dict: """Get content of a specific Confluence page. Args: page_id: Page ID """ return await confluence_tools.get_page_content(page_id=page_id) - mpo_mcp/confluence_tools.py:98-154 (helper)Core helper method in ConfluenceTools class that fetches page content using the Atlassian Confluence client, extracts metadata and storage body.
async def get_page_content( self, page_id: str, expand: Optional[str] = "body.storage,version" ) -> Dict[str, Any]: """ Get content of a specific Confluence page. Args: page_id: Page ID expand: Expand parameters (default: "body.storage,version") Returns: Page content and metadata """ self._check_client() try: page = self.client.get_page_by_id( page_id=page_id, expand=expand, ) result = { "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"]: result["url"] = f"{Config.CONFLUENCE_URL}{page['_links']['webui']}" # Add version info if "version" in page: result["version"] = { "number": page["version"].get("number"), "by": page["version"].get("by", {}).get("displayName"), "when": page["version"].get("when"), } # Add space info if "space" in page: result["space"] = { "key": page["space"].get("key"), "name": page["space"].get("name"), } # Add content if "body" in page and "storage" in page["body"]: result["content"] = page["body"]["storage"].get("value") return result except Exception as e: logger.error(f"Confluence API error: {e}") raise ValueError(f"Failed to get page content: {str(e)}")