Skip to main content
Glama
terrakube-io

Terrakube MCP Server

by terrakube-io

get-organization

Retrieve detailed information about a specific organization by its ID using the MCP server to manage Terrakube infrastructure efficiently.

Instructions

Retrieves detailed information about a specific organization by its ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesOrganization ID

Implementation Reference

  • The handler function for the 'get-organization' tool. It takes an organization ID, makes a GET request to the API endpoint `/organization/{id}`, handles errors, and returns the organization data as a formatted JSON string in the MCP response format.
    async ({ id }) => { const response = await fetch(`${CONFIG.apiUrl}/organization/${id}`, { headers: { Authorization: `Bearer ${CONFIG.patToken}`, "Content-Type": "application/vnd.api+json" } }); if (!response.ok) { throw new Error(`Failed to get organization: ${response.statusText}`); } const data = await response.json(); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; }
  • The input schema for the 'get-organization' tool, defining a required 'id' parameter as a string with description.
    { id: z.string().describe("Organization ID") },
  • The registration of the 'get-organization' tool on the MCP server using server.tool(), including name, description, input schema, and handler function. This is called within registerOrganizationTools which is invoked from src/index.ts.
    server.tool( "get-organization", "Retrieves detailed information about a specific organization by its ID", { id: z.string().describe("Organization ID") }, async ({ id }) => { const response = await fetch(`${CONFIG.apiUrl}/organization/${id}`, { headers: { Authorization: `Bearer ${CONFIG.patToken}`, "Content-Type": "application/vnd.api+json" } }); if (!response.ok) { throw new Error(`Failed to get organization: ${response.statusText}`); } const data = await response.json(); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } );
  • src/index.ts:22-22 (registration)
    Invocation of registerOrganizationTools(server) in the main server setup, which registers the 'get-organization' tool among others.
    registerOrganizationTools(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/terrakube-io/mcp-server-terrakube'

If you have feedback or need assistance with the MCP directory API, please join our Discord server