Skip to main content
Glama
Olson3R
by Olson3R

get_space_content

Extract pages from a Confluence space by specifying a space key, with options to set result limits, pagination, and body formats for efficient content retrieval.

Instructions

Get pages from a specific space

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyFormatNoBody format to include: "storage" or "view" (optional)
limitNoMaximum results (default: 25)
spaceKeyYesSpace key
startNoStarting index for pagination (default: 0)

Implementation Reference

  • The handler case for 'get_space_content' tool that extracts parameters from the request and calls the ConfluenceClient.getSpaceContent method, returning the result as JSON text content.
    case 'get_space_content': {
      const { spaceKey, limit = 25, start = 0, bodyFormat } = args as {
        spaceKey: string;
        limit?: number;
        start?: number;
        bodyFormat?: string;
      };
      
      const pages = await confluenceClient.getSpaceContent(spaceKey, limit, start, bodyFormat);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(pages, null, 2)
          }
        ]
      };
    }
  • The input schema defining parameters for the get_space_content tool, including spaceKey (required), limit, start, and bodyFormat.
    inputSchema: {
      type: 'object',
      properties: {
        spaceKey: {
          type: 'string',
          description: 'Space key'
        },
        limit: {
          type: 'number',
          description: 'Maximum results (default: 25)',
          default: 25
        },
        start: {
          type: 'number',
          description: 'Starting index for pagination (default: 0)',
          default: 0
        },
        bodyFormat: {
          type: 'string',
          description: 'Body format to include: "storage" or "view" (optional)',
          enum: ['storage', 'view']
        }
      },
      required: ['spaceKey']
    }
  • src/index.ts:208-236 (registration)
    The tool registration entry in the ListTools response, including name, description, and input schema for get_space_content.
    {
      name: 'get_space_content',
      description: 'Get pages from a specific space',
      inputSchema: {
        type: 'object',
        properties: {
          spaceKey: {
            type: 'string',
            description: 'Space key'
          },
          limit: {
            type: 'number',
            description: 'Maximum results (default: 25)',
            default: 25
          },
          start: {
            type: 'number',
            description: 'Starting index for pagination (default: 0)',
            default: 0
          },
          bodyFormat: {
            type: 'string',
            description: 'Body format to include: "storage" or "view" (optional)',
            enum: ['storage', 'view']
          }
        },
        required: ['spaceKey']
      }
    },
  • The core implementation of getSpaceContent in ConfluenceClient, which fetches pages from a space using the v2 API and optionally enhances with body content from v1 API, including space access validation.
    async getSpaceContent(spaceKey: string, limit = 25, start = 0, bodyFormat?: string): Promise<PaginatedResult<ConfluencePage>> {
      if (!validateSpaceAccess(spaceKey, this.config.allowedSpaces)) {
        throw new Error(`Access denied to space: ${spaceKey}`);
      }
    
      // Get basic page list from v2 API
      const response: AxiosResponse<PaginatedResult<ConfluencePage>> = await this.client.get('/pages', {
        params: {
          'space-key': spaceKey,
          limit,
          start
        }
      });
      
      // If body content is requested, enhance each page with body content from v1 API
      if (bodyFormat && response.data.results.length > 0) {
        const format = bodyFormat === 'view' ? 'body.view' : 'body.storage';
        const auth = Buffer.from(`${this.config.username}:${this.config.apiToken}`).toString('base64');
        
        const enhancedResults = await Promise.all(
          response.data.results.map(async (page) => {
            try {
              const v1Url = `${this.config.baseUrl}/wiki/rest/api/content/${page.id}?expand=${format},version,space`;
              const v1Response = await axios.get(v1Url, {
                headers: {
                  'Authorization': `Basic ${auth}`,
                  'Accept': 'application/json',
                  'Content-Type': 'application/json'
                },
                timeout: 30000
              });
              
              if (v1Response.data.body) {
                page.body = v1Response.data.body;
              }
            } catch (error) {
              if (this.config.debug) {
                console.warn(`Failed to retrieve body content for page ${page.id}:`, error);
              }
            }
            return page;
          })
        );
        
        response.data.results = enhancedResults;
      }
      
      return response.data;
    }
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 states the tool 'Get pages from a specific space', implying a read-only operation, but doesn't cover critical aspects like pagination behavior (handled by 'limit' and 'start' parameters), potential rate limits, authentication needs, or what happens if the space doesn't exist. For a tool with 4 parameters and no annotation coverage, this is a significant gap in behavioral context.

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 a single, efficient sentence: 'Get pages from a specific space'. It's front-loaded with the core action and resource, with zero wasted words. However, it could be slightly more specific (e.g., mentioning pagination or filtering) to improve utility without losing conciseness.

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 complexity (4 parameters, no output schema, no annotations), the description is incomplete. It doesn't explain the return values (e.g., what 'pages' includes, format based on 'bodyFormat'), pagination details, or error handling. With no output schema, the description should compensate by at least hinting at the response structure, but it doesn't, leaving the agent with insufficient context for 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?

The input schema has 100% description coverage, with clear documentation for all parameters (e.g., 'spaceKey' as 'Space key', 'bodyFormat' with enum values). The description adds no parameter-specific information beyond what's in the schema. According to the rules, when schema_description_coverage is high (>80%), the baseline is 3 even with no param info in the description, which applies here.

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

Purpose3/5

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

The description states the tool's purpose as 'Get pages from a specific space', which includes a verb ('Get') and resource ('pages from a specific space'), making it clear what the tool does. However, it doesn't distinguish this tool from similar siblings like 'get_page', 'get_page_children', or 'search_confluence', which also retrieve pages or content. The purpose is understandable but lacks differentiation from alternatives.

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 provides no guidance on when to use this tool versus alternatives. It doesn't mention scenarios like retrieving all pages in a space (vs. single pages with 'get_page'), hierarchical content (vs. 'get_page_children'), or filtered searches (vs. 'search_confluence'). There's no explicit or implied context for usage, leaving the agent to guess based on tool names alone.

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