Skip to main content
Glama
Olson3R
by Olson3R

get_space_by_key

Retrieve detailed information about a specific Confluence space using its unique key. Ideal for managing and organizing Confluence spaces efficiently.

Instructions

Get detailed information about a specific Confluence space by key

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spaceKeyYesSpace key

Implementation Reference

  • MCP tool handler for 'get_space_by_key': extracts spaceKey argument, calls ConfluenceClient.getSpaceByKey(), and returns the space object as formatted JSON text content.
    case 'get_space_by_key': {
      const { spaceKey } = args as {
        spaceKey: string;
      };
      
      const space = await confluenceClient.getSpaceByKey(spaceKey);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(space, null, 2)
          }
        ]
      };
    }
  • Tool schema definition including name, description, and input schema requiring 'spaceKey' string.
    {
      name: 'get_space_by_key',
      description: 'Get detailed information about a specific Confluence space by key',
      inputSchema: {
        type: 'object',
        properties: {
          spaceKey: {
            type: 'string',
            description: 'Space key'
          }
        },
        required: ['spaceKey']
      }
    },
  • Core implementation of getSpaceByKey in ConfluenceClient: validates space access, checks/uses cache, paginates listSpaces to find matching space by key, handles caching, and returns ConfluenceSpace.
    async getSpaceByKey(spaceKey: string): Promise<ConfluenceSpace> {
      if (!validateSpaceAccess(spaceKey, this.config.allowedSpaces)) {
        throw new Error(`Access denied to space: ${spaceKey}`);
      }
    
      // Check cache first
      if (this.isSpaceCacheValid(spaceKey)) {
        const cachedSpace = this.spaceCache.get(spaceKey);
        if (cachedSpace) {
          return cachedSpace;
        }
      }
    
      // Search through all pages using cursor-based pagination
      let cursor: string | undefined;
      let found = false;
      let space: ConfluenceSpace | undefined;
      
      do {
        const spaces = await this.listSpaces(100, cursor);
        space = spaces.results.find(s => s.key === spaceKey);
        
        if (space) {
          found = true;
          break;
        }
        
        // Extract cursor from _links.next if available
        cursor = undefined;
        if (spaces._links?.next) {
          const nextUrl = new URL(spaces._links.next);
          cursor = nextUrl.searchParams.get('cursor') || undefined;
        }
      } while (cursor);
      
      if (!found || !space) {
        throw new Error(`Space not found: ${spaceKey}`);
      }
      
      return space;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states it 'gets' information (implying a read operation) but doesn't specify whether this requires authentication, what happens if the space doesn't exist (error handling), rate limits, or what 'detailed information' includes. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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') and specifies the resource and identifier. There's no wasted language or redundancy, making it appropriately concise for a simple lookup tool.

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

Completeness3/5

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

Given the tool's low complexity (single parameter, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks details on authentication needs, error scenarios, or output format. For a read operation with no annotations, more context would be helpful, though the simplicity keeps it from being severely incomplete.

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 the single parameter 'spaceKey' documented as 'Space key' in the schema. The description adds minimal value beyond this by mentioning 'by key' to reinforce the parameter's purpose, but doesn't provide format examples, constraints, or additional context. Baseline 3 is appropriate when the schema already fully describes parameters.

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' and resource 'detailed information about a specific Confluence space by key', making the purpose unambiguous. It distinguishes from siblings like 'list_spaces' (which lists multiple spaces) and 'get_space_by_id' (which uses a different identifier). However, it doesn't explicitly contrast with 'get_space_content', which might retrieve different information about the same space.

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

Usage Guidelines3/5

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

The description implies usage when you need detailed information about a specific space identified by its key, but provides no explicit guidance on when to use this versus alternatives like 'get_space_by_id' or 'get_space_content'. It mentions 'by key' which helps differentiate from ID-based lookups, but lacks clear when/when-not rules or prerequisite context.

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