Skip to main content
Glama
terrakube-io

Terrakube MCP Server

by terrakube-io

edit-module

Modify module details like name, description, provider, and registry URL in the Terrakube MCP Server to ensure accurate infrastructure management.

Instructions

Updates an existing module's details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNoNew module description
moduleIdYesModule ID
nameNoNew module name
organizationIdYesOrganization ID
providerNoNew provider name
registryNoNew registry URL

Implementation Reference

  • Handler function for the 'edit-module' tool. Performs a PATCH request to the API to update the specified module's attributes (name, description, registry, provider) in the given organization.
    async ({ organizationId, moduleId, name, description, registry, provider }) => { const response = await fetch(`${CONFIG.apiUrl}/organization/${organizationId}/module/${moduleId}`, { method: "PATCH", headers: { Authorization: `Bearer ${CONFIG.patToken}`, "Content-Type": "application/vnd.api+json" }, body: JSON.stringify({ data: { type: "module", id: moduleId, attributes: { name, description, registry, provider } } }) }); if (response.status === 204) { return { content: [{ type: "text", text: "Module updated successfully" }] }; } else { throw new Error(`Failed to update module: ${response.statusText}`); } }
  • Zod input schema for the 'edit-module' tool, defining required organizationId and moduleId, and optional updatable fields.
    { organizationId: z.string().describe("Organization ID"), moduleId: z.string().describe("Module ID"), name: z.string().optional().describe("New module name"), description: z.string().optional().describe("New module description"), registry: z.string().optional().describe("New registry URL"), provider: z.string().optional().describe("New provider name") },
  • Direct registration of the 'edit-module' tool using server.tool(), including name, description, input schema, and handler function.
    server.tool( "edit-module", "Updates an existing module's details", { organizationId: z.string().describe("Organization ID"), moduleId: z.string().describe("Module ID"), name: z.string().optional().describe("New module name"), description: z.string().optional().describe("New module description"), registry: z.string().optional().describe("New registry URL"), provider: z.string().optional().describe("New provider name") }, async ({ organizationId, moduleId, name, description, registry, provider }) => { const response = await fetch(`${CONFIG.apiUrl}/organization/${organizationId}/module/${moduleId}`, { method: "PATCH", headers: { Authorization: `Bearer ${CONFIG.patToken}`, "Content-Type": "application/vnd.api+json" }, body: JSON.stringify({ data: { type: "module", id: moduleId, attributes: { name, description, registry, provider } } }) }); if (response.status === 204) { return { content: [{ type: "text", text: "Module updated successfully" }] }; } else { throw new Error(`Failed to update module: ${response.statusText}`); } } );

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