list_confluence_pages
List all pages in a Confluence space to get a complete inventory of page IDs, titles, and metadata. Ideal for exploring all content instead of searching specific terms.
Instructions
List all pages in a Confluence space. Best used when you need to explore all content in a specific space rather than searching for specific terms. Returns page IDs, titles, and metadata. TIP: Use this when search_confluence_pages might miss relevant pages or when you need a complete inventory of pages in a space.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spaceId | Yes | ID of the space to list pages from | |
| limit | No | Maximum number of pages to return (default: 25) | |
| start | No | Starting index for pagination (default: 0) |
Implementation Reference
- src/handlers/page-handlers.ts:22-59 (handler)The handler function for list_confluence_pages. Takes a ConfluenceClient and args (spaceId, limit, start), fetches pages via client.getConfluencePages(), transforms results to simplified format (id, title, spaceId, version, parentId), and returns JSON content.
export async function handleListConfluencePages( client: ConfluenceClient, args: { spaceId: string; limit?: number; start?: number } ): Promise<{ content: Array<{ type: "text"; text: string }>; }> { try { if (!args.spaceId) { throw new McpError(ErrorCode.InvalidParams, "spaceId is required"); } const pages = await client.getConfluencePages(args.spaceId, args.limit, args.start); const simplified = { results: pages.results.map(page => ({ id: page.id, title: page.title, spaceId: page.spaceId, version: page.version.number, parentId: page.parentId || null })), next: pages._links.next ? true : false }; return { content: [ { type: "text", text: JSON.stringify(simplified), }, ], }; } catch (error) { console.error("Error listing pages:", error instanceof Error ? error.message : String(error)); throw new McpError( ErrorCode.InternalError, `Failed to list pages: ${error instanceof Error ? error.message : String(error)}` ); } } - src/schemas/tool-schemas.ts:33-53 (schema)The input schema definition for list_confluence_pages. Defines description, and inputSchema with three properties: spaceId (string, required), limit (number, optional), start (number, optional).
list_confluence_pages: { description: "List all pages in a Confluence space. Best used when you need to explore all content in a specific space rather than searching for specific terms. Returns page IDs, titles, and metadata. TIP: Use this when search_confluence_pages might miss relevant pages or when you need a complete inventory of pages in a space.", inputSchema: { type: "object", properties: { spaceId: { type: "string", description: "ID of the space to list pages from", }, limit: { type: "number", description: "Maximum number of pages to return (default: 25)", }, start: { type: "number", description: "Starting index for pagination (default: 0)", }, }, required: ["spaceId"], }, }, - src/index.ts:209-213 (registration)The registration of the list_confluence_pages tool in the main server's CallToolRequestSchema handler switch statement. It extracts spaceId, limit, start from args, validates spaceId is present, and delegates to handleListConfluencePages.
case "list_confluence_pages": { const { spaceId, limit, start } = (args || {}) as { spaceId: string; limit?: number; start?: number }; if (!spaceId) throw new McpError(ErrorCode.InvalidParams, "spaceId is required"); return await handleListConfluencePages(this.confluenceClient, { spaceId, limit, start }); } - The ConfluenceClient.getConfluencePages() method that actually calls the Confluence API v2 /pages endpoint with spaceId, limit, start, and status=current parameters. This is the underlying API call used by the handler.
async getConfluencePages(spaceId: string, limit = 25, start = 0, title?: string): Promise<PaginatedResponse<Page>> { const response = await this.v2Client.get('/pages', { params: { spaceId, limit, start, status: 'current', ...(title && { title }) } }); return response.data; } - src/index.ts:22-22 (registration)The import of handleListConfluencePages from the page-handlers module at the top of index.ts.
handleListConfluencePages,