confluence_get_page
Retrieve a Confluence page by its ID to access its content, version history, and metadata for documentation or analysis.
Instructions
Get a Confluence page by ID including its content, version, and metadata
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pageId | Yes | The ID of the page to retrieve |
Implementation Reference
- index.js:434-444 (handler)The tool handler for 'confluence_get_page'. It calls getPage(args.pageId) and returns the result as JSON.
case 'confluence_get_page': { const result = await getPage(args.pageId); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; } - index.js:81-90 (helper)The getPage() async function that makes the Confluence API call to fetch a page by its ID, expanding body.storage, version, space, and ancestors.
async function getPage(pageId) { try { const response = await client.get(`${CONFLUENCE_API_BASE}/content/${pageId}`, { params: { expand: 'body.storage,version,space,ancestors' } }); return response.data; } catch (error) { throw new Error(`Failed to get page: ${error.message}`); } } - index.js:265-278 (schema)Input schema registration for the 'confluence_get_page' tool, defining the pageId string parameter as required.
{ name: 'confluence_get_page', description: 'Get a Confluence page by ID including its content, version, and metadata', inputSchema: { type: 'object', properties: { pageId: { type: 'string', description: 'The ID of the page to retrieve', }, }, required: ['pageId'], }, }, - index.js:227-398 (registration)The ListToolsRequestSchema handler where the tool 'confluence_get_page' is registered along with all other tools.
server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ { name: 'confluence_search', description: 'Search Confluence content using CQL (Confluence Query Language). Example queries: "type=page AND title~\\"API\\"", "type=page ORDER BY lastmodified DESC"', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'CQL search query (e.g., "type=page AND title~\\"keyword\\"")', }, limit: { type: 'number', description: 'Maximum number of results (default: 10)', }, spaceKey: { type: 'string', description: 'Optional space key to limit search to a specific space', }, }, required: ['query'], }, }, { name: 'confluence_list_spaces', description: 'List all Confluence spaces accessible to the user', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Maximum number of spaces to return (default: 25)', }, }, }, }, { name: 'confluence_get_page', description: 'Get a Confluence page by ID including its content, version, and metadata', inputSchema: { type: 'object', properties: { pageId: { type: 'string', description: 'The ID of the page to retrieve', }, }, required: ['pageId'], }, }, { name: 'confluence_get_page_by_title', description: 'Find a Confluence page by its title and space key', inputSchema: { type: 'object', properties: { title: { type: 'string', description: 'The exact title of the page', }, spaceKey: { type: 'string', description: 'The key of the space containing the page', }, }, required: ['title', 'spaceKey'], }, }, { name: 'confluence_get_space', description: 'Get information about a specific Confluence space', inputSchema: { type: 'object', properties: { spaceKey: { type: 'string', description: 'The key of the space to retrieve', }, }, required: ['spaceKey'], }, }, { name: 'confluence_create_page', description: 'Create a new Confluence page in a specific space', inputSchema: { type: 'object', properties: { title: { type: 'string', description: 'The title of the new page', }, spaceKey: { type: 'string', description: 'The key of the space where the page will be created', }, content: { type: 'string', description: 'The page content in Confluence storage format (HTML)', }, parentId: { type: 'string', description: 'Optional ID of the parent page (creates a child page)', }, }, required: ['title', 'spaceKey', 'content'], }, }, { name: 'confluence_update_page', description: 'Update an existing Confluence page', inputSchema: { type: 'object', properties: { pageId: { type: 'string', description: 'The ID of the page to update', }, title: { type: 'string', description: 'The new title for the page', }, content: { type: 'string', description: 'The new content in Confluence storage format (HTML)', }, version: { type: 'number', description: 'Current version number of the page (will be incremented)', }, }, required: ['pageId', 'title', 'content', 'version'], }, }, { name: 'confluence_add_labels', description: 'Add labels (tags) to a Confluence page', inputSchema: { type: 'object', properties: { pageId: { type: 'string', description: 'The ID of the page', }, labels: { type: 'array', items: { type: 'string' }, description: 'Array of label names to add', }, }, required: ['pageId', 'labels'], }, }, { name: 'confluence_get_attachments', description: 'Get list of attachments for a Confluence page', inputSchema: { type: 'object', properties: { pageId: { type: 'string', description: 'The ID of the page', }, }, required: ['pageId'], }, }, ], }; });