get_page_content
Fetch Confluence page content using the Confluence Communication Server by specifying the page ID. Enable quick access to stored information for streamlined workflows.
Instructions
Get the content of a Confluence page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pageId | Yes | Confluence Page ID |
Implementation Reference
- src/index.ts:134-149 (handler)Core handler function that fetches the content of a Confluence page by pageId using the REST API, with error handling.async function getPageContent(pageId: string): Promise<any> { try { const response = await axios.get( `${CONFLUENCE_URL}/wiki/rest/api/content/${pageId}?expand=body.storage,version`, { headers: getAuthHeaders().headers, }, ); return response.data; } catch (error: any) { return { error: error.response ? error.response.data : error.message, }; } }
- src/index.ts:60-72 (registration)Registration of the 'get_page_content' tool in the listTools response, including description and input schema.name: 'get_page_content', description: 'Get the content of a Confluence page', inputSchema: { type: 'object', properties: { pageId: { type: 'string', description: 'Confluence Page ID', }, }, required: ['pageId'], }, },
- src/index.ts:251-268 (handler)MCP CallToolRequestSchema handler case for 'get_page_content', which validates input and invokes the getPageContent function.case 'get_page_content': { const pageId = String(request.params.arguments?.pageId); if (!pageId) { throw new Error('Page ID is required'); } const response = await getPageContent(pageId); return { content: [ { type: 'text', text: JSON.stringify(response, null, 2), }, ], }; }