Skip to main content
Glama
terrakube-io

Terrakube MCP Server

by terrakube-io

list-organizations

Retrieve all organizations accessible to the current user within the Terrakube MCP Server, facilitating efficient workspace and infrastructure management.

Instructions

Lists all organizations accessible to the current user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'list-organizations' tool. It makes a GET request to the /organization API endpoint using the configured API URL and PAT token, parses the JSON response, and returns it as a text content block.
    async () => { const response = await fetch(`${CONFIG.apiUrl}/organization`, { headers: { Authorization: `Bearer ${CONFIG.patToken}`, "Content-Type": "application/vnd.api+json" } }); if (!response.ok) { throw new Error(`Failed to list organizations: ${response.statusText}`); } const data = await response.json(); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; }
  • The registration of the 'list-organizations' tool on the MCP server within the registerOrganizationTools function. Includes empty input schema {} and inline handler.
    server.tool( "list-organizations", "Lists all organizations accessible to the current user", {}, async () => { const response = await fetch(`${CONFIG.apiUrl}/organization`, { headers: { Authorization: `Bearer ${CONFIG.patToken}`, "Content-Type": "application/vnd.api+json" } }); if (!response.ok) { throw new Error(`Failed to list organizations: ${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 on the MCP server instance, which registers the 'list-organizations' 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