Skip to main content
Glama
aaronsb

Confluence MCP Server

get_confluence_space

Retrieve detailed information about a Confluence space by providing its space ID. Returns space metadata such as name, key, and description.

Instructions

Get details about a specific space

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spaceIdYesID of the space to retrieve

Implementation Reference

  • The handler function for the 'get_confluence_space' tool. Takes a ConfluenceClient and args with spaceId, fetches the space via client.getConfluenceSpace(), and returns a simplified response with id, name, key, status, homepage, and url.
    export async function handleGetConfluenceSpace(
      client: ConfluenceClient,
      args: { spaceId: string }
    ): Promise<{
      content: Array<{ type: "text"; text: string }>;
    }> {
      try {
        if (!args.spaceId) {
          throw new McpError(ErrorCode.InvalidParams, "spaceId is required");
        }
    
        const space = await client.getConfluenceSpace(args.spaceId);
        // Transform to minimal format
        const simplified = {
          id: space.id,
          name: space.name,
          key: space.key,
          status: space.status,
          homepage: space.homepageId,
          url: space._links.webui
        };
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(simplified),
            },
          ],
        };
      } catch (error) {
        console.error("Error getting space:", error instanceof Error ? error.message : String(error));
        if (error instanceof McpError) {
          throw error;
        }
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to get space: ${error instanceof Error ? error.message : String(error)}`
        );
      }
    }
  • The input schema for the 'get_confluence_space' tool. Defines a required 'spaceId' string parameter and provides a description.
    get_confluence_space: {
      description: "Get details about a specific space",
      inputSchema: {
        type: "object",
        properties: {
          spaceId: {
            type: "string",
            description: "ID of the space to retrieve",
          },
        },
        required: ["spaceId"],
      },
    },
  • src/index.ts:202-206 (registration)
    Registration of the 'get_confluence_space' tool in the main server switch statement. Extracts spaceId from args, validates it, and delegates to handleGetConfluenceSpace.
    case "get_confluence_space": {
      const { spaceId } = (args || {}) as { spaceId: string };
      if (!spaceId) throw new McpError(ErrorCode.InvalidParams, "spaceId is required");
      return await handleGetConfluenceSpace(this.confluenceClient, { spaceId });
    }
  • The helper/client method getConfluenceSpace() that makes the actual API call to fetch a space by ID from Confluence's v2 API.
    async getConfluenceSpace(spaceId: string): Promise<Space> {
      const response = await this.v2Client.get(`/spaces/${spaceId}`);
      return response.data;
    }
  • src/index.ts:31-31 (registration)
    Import of handleGetConfluenceSpace from space-handlers into the main server file.
    import { handleGetConfluenceSpace, handleListConfluenceSpaces } from "./handlers/space-handlers.js";
Behavior2/5

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

No annotations provided, so the description must fully convey behavior. It implies a read operation but does not disclose any permissions needed, rate limits, or other potential side effects beyond basic retrieval.

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 extremely concise, front-loading the purpose in a single sentence with no unnecessary words.

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?

While the tool is simple, the description does not hint at the output structure or what 'details' entail, which is important given the absence of an output schema. The description could be more complete to guide the agent.

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 parameter 'spaceId' is fully described in the schema with 100% coverage, and the description adds no additional meaning beyond what the schema provides.

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 the tool retrieves details for a specific space, distinguishing it from sibling tools like list_confluence_spaces that list multiple spaces.

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?

No guidance on when to use this tool vs alternatives such as list_confluence_spaces or get_confluence_page. The description lacks explicit context or exclusions.

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