Skip to main content
Glama
Olson3R
by Olson3R

get_space_by_id

Retrieve detailed information about a Confluence space using its unique ID. This tool enables efficient management and access to Confluence space data.

Instructions

Get detailed information about a specific Confluence space by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spaceIdYesSpace ID

Implementation Reference

  • Core handler function that retrieves a Confluence space by ID. Checks cache first, fetches from API if needed, validates space access, caches the result, and returns the space data.
    async getSpaceById(spaceId: string): Promise<ConfluenceSpace> {
      // Check if we have this space in cache by ID
      for (const [key, space] of this.spaceCache.entries()) {
        if (space.id === spaceId && this.isSpaceCacheValid(key)) {
          return space;
        }
      }
      
      // Note: Since we only have access to space keys in configuration, we need to validate by key
      // This method is primarily for internal use after we've obtained a space ID
      const response: AxiosResponse<ConfluenceSpace> = await this.client.get(`/spaces/${spaceId}`);
      
      // Validate access after getting the space data
      if (!validateSpaceAccess(response.data.key, this.config.allowedSpaces)) {
        throw new Error(`Access denied to space: ${response.data.key}`);
      }
      
      // Cache the space
      this.cacheSpace(response.data);
      
      return response.data;
    }
  • src/index.ts:180-193 (registration)
    Tool registration in the MCP server's list_tools response, including name, description, and input schema definition.
    {
      name: 'get_space_by_id',
      description: 'Get detailed information about a specific Confluence space by ID',
      inputSchema: {
        type: 'object',
        properties: {
          spaceId: {
            type: 'string',
            description: 'Space ID'
          }
        },
        required: ['spaceId']
      }
    },
  • MCP tool dispatch handler that extracts the spaceId argument, calls the ConfluenceClient.getSpaceById method, and formats the response as MCP content.
    case 'get_space_by_id': {
      const { spaceId } = args as {
        spaceId: string;
      };
      
      const space = await confluenceClient.getSpaceById(spaceId);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(space, null, 2)
          }
        ]
      };
    }
  • TypeScript interface defining the structure of a ConfluenceSpace object, used as the return type for getSpaceById.
    export interface ConfluenceSpace {
      id: string;
      key: string;
      name: string;
      type: string;
      status: string;
      _links: {
        webui: string;
        self: string;
      };
    }
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 retrieves 'detailed information,' but doesn't specify what details are included (e.g., permissions, content, metadata), whether it's a read-only operation, or if there are rate limits or authentication requirements. This leaves significant gaps for a tool that likely interacts with a Confluence API.

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 that front-loads the core action ('Get detailed information') without unnecessary words. Every part of the sentence contributes to understanding the tool's purpose, making it appropriately concise and well-structured.

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 what 'detailed information' entails in the return values, nor does it cover behavioral aspects like error handling or API constraints. For a tool with one parameter but potential complexity in Confluence space data, this minimal description leaves too much unspecified.

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 schema description coverage is 100%, with the single parameter 'spaceId' documented as 'Space ID' in the schema. The description adds no additional meaning beyond this, such as format examples (e.g., numeric vs. string IDs) or where to obtain the ID. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

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 ('Get detailed information') and resource ('about a specific Confluence space by ID'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get_space_by_key' or 'get_space_content', which likely retrieve similar information through different identifiers or scopes.

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 prerequisites (e.g., needing a space ID), exclusions, or comparisons to siblings such as 'get_space_by_key' (which might use a key instead of ID) or 'list_spaces' (which retrieves multiple spaces).

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