get-module
Retrieve detailed information about a specific module by providing the module ID and organization ID within the Terrakube MCP Server infrastructure.
Instructions
Retrieves detailed information about a specific module
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| moduleId | Yes | Module ID | |
| organizationId | Yes | Organization ID |
Implementation Reference
- src/tools/modules.ts:45-64 (handler)The handler function that implements the 'get-module' tool logic: fetches detailed information about a specific module from the Terrakube API using the provided organizationId and moduleId, parses the JSON response, and returns it formatted as text content.async ({ organizationId, moduleId }) => { const response = await fetch(`${CONFIG.apiUrl}/organization/${organizationId}/module/${moduleId}`, { headers: { Authorization: `Bearer ${CONFIG.patToken}`, "Content-Type": "application/vnd.api+json" } }); if (!response.ok) { throw new Error(`Failed to get module: ${response.statusText}`); } const data = await response.json(); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; }
- src/tools/modules.ts:41-44 (schema)Zod input schema for the 'get-module' tool, defining required string parameters organizationId and moduleId with descriptions.{ organizationId: z.string().describe("Organization ID"), moduleId: z.string().describe("Module ID") },
- src/tools/modules.ts:38-65 (registration)Direct registration of the 'get-module' tool on the MCP server using server.tool(), including name, description, schema, and handler.server.tool( "get-module", "Retrieves detailed information about a specific module", { organizationId: z.string().describe("Organization ID"), moduleId: z.string().describe("Module ID") }, async ({ organizationId, moduleId }) => { const response = await fetch(`${CONFIG.apiUrl}/organization/${organizationId}/module/${moduleId}`, { headers: { Authorization: `Bearer ${CONFIG.patToken}`, "Content-Type": "application/vnd.api+json" } }); if (!response.ok) { throw new Error(`Failed to get module: ${response.statusText}`); } const data = await response.json(); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } );
- src/index.ts:24-24 (registration)Higher-level registration call to registerModuleTools(server) in the main server setup, which includes the 'get-module' tool.registerModuleTools(server);