Skip to main content
Glama
terrakube-io

Terrakube MCP Server

by terrakube-io

list-modules

Retrieve all modules within a specified organization using the Terrakube MCP Server for efficient infrastructure management and organization operations.

Instructions

Lists all modules in the specified organization

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
organizationIdYesOrganization ID

Implementation Reference

  • Handler function that fetches the list of modules from the API for the given organization ID and returns the JSON response as text content.
    async ({ organizationId }) => { const response = await fetch(`${CONFIG.apiUrl}/organization/${organizationId}/module`, { headers: { Authorization: `Bearer ${CONFIG.patToken}`, "Content-Type": "application/vnd.api+json" } }); if (!response.ok) { throw new Error(`Failed to list modules: ${response.statusText}`); } const data = await response.json(); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } );
  • Input schema for the tool, requiring an organizationId string.
    { organizationId: z.string().describe("Organization ID") },
  • Direct registration of the 'list-modules' tool on the MCP server, including schema and handler.
    server.tool( "list-modules", "Lists all modules in the specified organization", { organizationId: z.string().describe("Organization ID") }, async ({ organizationId }) => { const response = await fetch(`${CONFIG.apiUrl}/organization/${organizationId}/module`, { headers: { Authorization: `Bearer ${CONFIG.patToken}`, "Content-Type": "application/vnd.api+json" } }); if (!response.ok) { throw new Error(`Failed to list modules: ${response.statusText}`); } const data = await response.json(); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } );
  • src/index.ts:24-24 (registration)
    Top-level call to registerModuleTools, which registers the 'list-modules' tool among others.
    registerModuleTools(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