confluence_get_attachments
Retrieve all attachments from a specified Confluence page by providing its page ID.
Instructions
Get list of attachments for a Confluence page
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pageId | Yes | The ID of the page |
Implementation Reference
- index.js:201-211 (handler)The handler function `getAttachments(pageId)` that fetches attachments from Confluence API.
async function getAttachments(pageId) { try { const response = await client.get( `${CONFLUENCE_API_BASE}/content/${pageId}/child/attachment`, { params: { expand: 'version' } } ); return response.data; } catch (error) { throw new Error(`Failed to get attachments: ${error.message}`); } } - index.js:382-395 (registration)Registration of the tool `confluence_get_attachments` with its name, description, and inputSchema (requires pageId).
{ 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'], }, }, - index.js:516-526 (helper)The call handler case that delegates to `getAttachments(args.pageId)` when the tool is invoked.
case 'confluence_get_attachments': { const result = await getAttachments(args.pageId); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; } - index.js:385-394 (schema)The input schema for the tool, defining pageId as a required string parameter.
inputSchema: { type: 'object', properties: { pageId: { type: 'string', description: 'The ID of the page', }, }, required: ['pageId'], },