confluence_get_page_by_title
Retrieve a Confluence page by providing its exact title and space key. Access page content without manual browsing.
Instructions
Find a Confluence page by its title and space key
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | The exact title of the page | |
| spaceKey | Yes | The key of the space containing the page |
Implementation Reference
- index.js:95-112 (handler)The core handler function that executes the tool logic. Makes a GET request to Confluence API /content with title and spaceKey params, returns the first result or throws 'Page not found'.
async function getPageByTitle(title, spaceKey) { try { const response = await client.get(`${CONFLUENCE_API_BASE}/content`, { params: { title, spaceKey, expand: 'body.storage,version,space' } }); if (response.data.results && response.data.results.length > 0) { return response.data.results[0]; } throw new Error(`Page not found: ${title} in space ${spaceKey}`); } catch (error) { throw new Error(`Failed to get page by title: ${error.message}`); } } - index.js:280-295 (schema)Input schema definition for the tool. Declares 'title' (string) and 'spaceKey' (string) as required parameters.
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'], }, - index.js:279-296 (registration)Tool registration within the ListToolsRequestSchema handler, listing 'confluence_get_page_by_title' as one of the available tools.
{ 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'], }, }, - index.js:446-456 (handler)The case branch in the CallToolRequestSchema switch statement that invokes getPageByTitle() and returns the result.
case 'confluence_get_page_by_title': { const result = await getPageByTitle(args.title, args.spaceKey); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }