Skip to main content
Glama
aaronsb

Confluence MCP Server

list_confluence_spaces

List all Confluence spaces to discover available content. Returns space IDs, names, and keys for use with other tools. Ideal first step in a content discovery workflow.

Instructions

List all available Confluence spaces. Best used as the first step in a content discovery workflow. Returns space IDs, names, and keys that you can use with other tools. TIP: Use a higher limit (e.g., 100) on first call to get a comprehensive view of available spaces.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of spaces to return (default: 25)
startNoStarting index for pagination (default: 0)

Implementation Reference

  • The main handler function for the 'list_confluence_spaces' tool. Calls ConfluenceClient.getConfluenceSpaces(), transforms results to a simplified format (id, name, key, status), and returns paginated JSON. Includes error handling with McpError.
    export async function handleListConfluenceSpaces(
      client: ConfluenceClient,
      args: { limit?: number; start?: number }
    ): Promise<{
      content: Array<{ type: "text"; text: string }>;
    }> {
      try {
        const spaces = await client.getConfluenceSpaces(args.limit, args.start);
        // Transform to minimal format
        const simplified = {
          results: spaces.results.map(space => ({
            id: space.id,
            name: space.name,
            key: space.key,
            status: space.status
          })),
          next: spaces._links.next ? true : false
        };
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(simplified),
            },
          ],
        };
      } catch (error) {
        console.error("Error listing spaces:", error instanceof Error ? error.message : String(error));
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to list spaces: ${error instanceof Error ? error.message : String(error)}`
        );
      }
    }
  • Input schema definition for 'list_confluence_spaces'. Describes the tool as listing all available Confluence spaces as a first step in content discovery. Accepts optional 'limit' (number, default 25) and 'start' (number, default 0) for pagination.
    list_confluence_spaces: {
      description: "List all available Confluence spaces. Best used as the first step in a content discovery workflow. Returns space IDs, names, and keys that you can use with other tools. TIP: Use a higher limit (e.g., 100) on first call to get a comprehensive view of available spaces.",
      inputSchema: {
        type: "object",
        properties: {
          limit: {
            type: "number",
            description: "Maximum number of spaces to return (default: 25)",
          },
          start: {
            type: "number",
            description: "Starting index for pagination (default: 0)",
          },
        },
      },
    },
  • src/index.ts:196-201 (registration)
    Tool registration in the main server's CallToolRequestSchema handler. The tool name 'list_confluence_spaces' is matched in a switch statement, extracts limit/start from args, and delegates to handleListConfluenceSpaces().
    switch (name) {
      // Space operations
      case "list_confluence_spaces": {
        const { limit, start } = (args || {}) as { limit?: number; start?: number };
        return await handleListConfluenceSpaces(this.confluenceClient, { limit, start });
      }
  • src/index.ts:120-131 (registration)
    Tool listing registration via ListToolsRequestSchema. Iterates over toolSchemas object (which includes 'list_confluence_spaces') to expose each tool's name, description, and inputSchema to the MCP protocol.
    // Set up required MCP protocol handlers
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: Object.entries(toolSchemas).map(([key, schema]) => ({
        name: key,
        description: schema.description,
        inputSchema: {
          type: "object",
          properties: schema.inputSchema.properties,
          ...(("required" in schema.inputSchema) ? { required: schema.inputSchema.required } : {}),
        },
      })),
    }));
  • The underlying ConfluenceClient method 'getConfluenceSpaces()' that makes the actual HTTP GET request to /api/v2/spaces with limit/start params. Returns a PaginatedResponse<Space>.
    // Space operations
    async getConfluenceSpaces(limit = 25, start = 0): Promise<PaginatedResponse<Space>> {
      if (!this.verified) {
        await this.verifyApiConnection();
        this.verified = true;
      }
      const response = await this.v2Client.get('/spaces', {
        params: { limit, start }
      });
      return response.data;
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden. It mentions return values (space IDs, names, keys) and offers a tip about using a higher limit, but it does not disclose potential issues like rate limits, errors, or side effects. A 3 is appropriate as it adds some behavioral context but lacks comprehensive transparency.

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

Conciseness4/5

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

The description is concise: two sentences and a tip. It is front-loaded with the main purpose. The structure is clear, though the tip could be integrated.

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?

Given no output schema, the description explains the return values (IDs, names, keys) and hints at pagination with limit and start. This is mostly complete for a listing tool, though it could mention pagination behavior more explicitly.

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 baseline is 3. The description adds value by suggesting a higher limit and mentioning pagination implicitly, but it does not go beyond the schema's description significantly. The tip about limit adds practical context.

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 'List all available Confluence spaces,' providing a specific verb-resource combination. It also distinguishes itself by noting it is the best first step in a content discovery workflow and that it returns IDs, names, and keys for use with other tools.

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

Usage Guidelines4/5

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

The description advises using this tool as the first step and recommends a higher limit on the first call. While it does not explicitly list when not to use it or compare with siblings, the context signals imply it is for initial enumeration, not for searching or filtering.

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