Skip to main content
Glama
Olson3R
by Olson3R

list_spaces

Generate a filtered list of accessible Confluence spaces with pagination support. Configure results limit and cursor for efficient space management.

Instructions

List all accessible Confluence spaces (filtered by allowed spaces)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cursorNoCursor for pagination (from _links.next)
limitNoMaximum results (default: 50)

Implementation Reference

  • MCP tool handler for 'list_spaces' that extracts input parameters, calls ConfluenceClient.listSpaces(), and returns the JSON-formatted result.
    case 'list_spaces': {
      const { limit = 50, cursor } = args as {
        limit?: number;
        cursor?: string;
      };
      
      const spaces = await confluenceClient.listSpaces(limit, cursor);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(spaces, null, 2)
          }
        ]
      };
    }
  • Input schema definition for the list_spaces tool, specifying optional limit and cursor parameters.
    inputSchema: {
      type: 'object',
      properties: {
        limit: {
          type: 'number',
          description: 'Maximum results (default: 50)',
          default: 50
        },
        cursor: {
          type: 'string',
          description: 'Cursor for pagination (from _links.next)'
        }
      }
  • src/index.ts:162-179 (registration)
    Registration of the list_spaces tool in the ListToolsRequestSchema handler, including name, description, and input schema.
    {
      name: 'list_spaces',
      description: 'List all accessible Confluence spaces (filtered by allowed spaces)',
      inputSchema: {
        type: 'object',
        properties: {
          limit: {
            type: 'number',
            description: 'Maximum results (default: 50)',
            default: 50
          },
          cursor: {
            type: 'string',
            description: 'Cursor for pagination (from _links.next)'
          }
        }
      }
    },
  • Helper method in ConfluenceClient that implements the core listSpaces logic: API call to /spaces, filters by allowed spaces, caches results, and returns paginated response.
    async listSpaces(limit = 50, cursor?: string): Promise<PaginatedResult<ConfluenceSpace>> {
      const params: any = { limit };
      if (cursor) {
        params.cursor = cursor;
      }
      
      const response: AxiosResponse<PaginatedResult<ConfluenceSpace>> = await this.client.get('/spaces', {
        params
      });
      
      const filteredResults = response.data.results.filter(space => 
        validateSpaceAccess(space.key, this.config.allowedSpaces)
      );
      
      // Cache the spaces
      filteredResults.forEach(space => this.cacheSpace(space));
      
      return {
        ...response.data,
        results: filteredResults,
        size: filteredResults.length
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions filtering by 'allowed spaces', which adds some context about access control, but it doesn't describe other key behaviors such as pagination mechanics (implied by the cursor parameter), rate limits, authentication needs, or what the output looks like (e.g., list format).

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?

The description is a single, efficient sentence with no wasted words. It's front-loaded with the core purpose and includes a concise parenthetical for additional context, making it easy to parse quickly.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain the return values (e.g., what data is included in the list), how pagination works in practice, or error conditions. For a list tool with two parameters and no structured output documentation, more context is needed to guide effective use.

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 description coverage is 100%, with clear documentation for both parameters ('cursor' for pagination and 'limit' for maximum results). The description doesn't add any additional meaning beyond what the schema provides, such as explaining how 'allowed spaces' filtering interacts with these parameters. Baseline 3 is appropriate since the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the verb ('List') and resource ('all accessible Confluence spaces'), making the purpose evident. However, it doesn't explicitly differentiate from sibling tools like 'get_space_by_id' or 'get_space_by_key', which retrieve specific spaces rather than listing all accessible ones.

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

Usage Guidelines2/5

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

The description includes a parenthetical note about filtering by 'allowed spaces', which provides some context, but it doesn't offer explicit guidance on when to use this tool versus alternatives like 'search_confluence' or the 'get_space_by_*' tools. No exclusions or prerequisites are mentioned.

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

Related 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/Olson3R/confluence-mcp'

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