Skip to main content
Glama

get_confluence_space

Retrieve detailed information about a specific Confluence space by providing its unique ID to access space configurations and content structure.

Instructions

Get details about a specific space

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spaceIdYesID of the space to retrieve

Implementation Reference

  • The main handler function for the 'get_confluence_space' tool. It validates the spaceId, fetches the space using the ConfluenceClient, simplifies the response, and returns it as JSON text content.
    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 and description for the 'get_confluence_space' tool, defining the required 'spaceId' parameter.
    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 and dispatching of the 'get_confluence_space' tool in the main server request handler switch statement, which calls the handler function.
    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 ConfluenceClient helper method that performs the actual API call to retrieve a specific space by ID.
    async getConfluenceSpace(spaceId: string): Promise<Space> { const response = await this.v2Client.get(`/spaces/${spaceId}`); return response.data; }
  • src/index.ts:31-31 (registration)
    Import statement registering the handler function for use in the main server.
    import { handleGetConfluenceSpace, handleListConfluenceSpaces } from "./handlers/space-handlers.js";

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