Skip to main content
Glama
terrakube-io

Terrakube MCP Server

by terrakube-io

edit-workspace

Modify workspace details such as name, Terraform version, VCS provider, repository URL, and description in the Terrakube MCP Server for streamlined infrastructure management.

Instructions

Updates an existing workspace's details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNoNew workspace description
nameNoNew workspace name
organizationIdYesOrganization ID
terraformVersionNoNew Terraform version
vcsProviderNoNew VCS provider
vcsRepoNoNew VCS repository URL
workspaceIdYesWorkspace ID

Implementation Reference

  • The async handler function for the 'edit-workspace' tool that performs a PATCH request to the API to update the workspace details.
    async ({ organizationId, workspaceId, name, description, terraformVersion, vcsProvider, vcsRepo }) => { const response = await fetch(`${CONFIG.apiUrl}/organization/${organizationId}/workspace/${workspaceId}`, { method: "PATCH", headers: { Authorization: `Bearer ${CONFIG.patToken}`, "Content-Type": "application/vnd.api+json" }, body: JSON.stringify({ data: { type: "workspace", id: workspaceId, attributes: { name, description, terraformVersion, vcsProvider, vcsRepo } } }) }); if (response.status === 204) { return { content: [{ type: "text", text: "Workspace updated successfully" }] }; } else { throw new Error(`Failed to update workspace: ${response.statusText}`); } }
  • Zod input schema defining parameters for the 'edit-workspace' tool, including organizationId, workspaceId, and optional attributes to update.
    { organizationId: z.string().describe("Organization ID"), workspaceId: z.string().describe("Workspace ID"), name: z.string().optional().describe("New workspace name"), description: z.string().optional().describe("New workspace description"), terraformVersion: z.string().optional().describe("New Terraform version"), vcsProvider: z.string().optional().describe("New VCS provider"), vcsRepo: z.string().optional().describe("New VCS repository URL") },
  • The server.tool() call that registers the 'edit-workspace' tool with its name, description, input schema, and handler function.
    server.tool( "edit-workspace", "Updates an existing workspace's details", { organizationId: z.string().describe("Organization ID"), workspaceId: z.string().describe("Workspace ID"), name: z.string().optional().describe("New workspace name"), description: z.string().optional().describe("New workspace description"), terraformVersion: z.string().optional().describe("New Terraform version"), vcsProvider: z.string().optional().describe("New VCS provider"), vcsRepo: z.string().optional().describe("New VCS repository URL") }, async ({ organizationId, workspaceId, name, description, terraformVersion, vcsProvider, vcsRepo }) => { const response = await fetch(`${CONFIG.apiUrl}/organization/${organizationId}/workspace/${workspaceId}`, { method: "PATCH", headers: { Authorization: `Bearer ${CONFIG.patToken}`, "Content-Type": "application/vnd.api+json" }, body: JSON.stringify({ data: { type: "workspace", id: workspaceId, attributes: { name, description, terraformVersion, vcsProvider, vcsRepo } } }) }); if (response.status === 204) { return { content: [{ type: "text", text: "Workspace updated successfully" }] }; } else { throw new Error(`Failed to update workspace: ${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