Skip to main content
Glama
aaronsb

Confluence MCP Server

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

TableJSON Schema
NameRequiredDescriptionDefault
spaceIdYesID of the space to list pages from
limitNoMaximum number of pages to return (default: 25)
startNoStarting index for pagination (default: 0)

Implementation Reference

  • 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)}`
        );
      }
    }
  • 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,
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It mentions returns include page IDs, titles, and metadata, but lacks details on pagination behavior, rate limits, or any side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences plus a tip, with no wasted words. Front-loads the core purpose and follows with usage guidance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Lacks output schema but describes return fields (page IDs, titles, metadata). Could mention pagination details or result limits, but schema covers parameters; still adequate for a list tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the description adds no additional parameter context beyond what's in the schema. It mentions 'space' but doesn't elaborate on parameters like limit or start.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists all pages in a Confluence space, distinguishing it from the sibling search_confluence_pages by specifying exploration of all content vs. searching for specific terms.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly advises using this tool when search_confluence_pages might miss relevant pages or for a complete inventory, providing clear when-to-use guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aaronsb/confluence-cloud-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server