Skip to main content
Glama

infracost_cloud_delete_guardrail

Remove cost guardrails from Infracost Cloud to eliminate cloud spending controls and modify governance policies for your infrastructure.

Instructions

Delete a guardrail from Infracost Cloud. Requires INFRACOST_SERVICE_TOKEN environment variable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orgSlugNoOrganization slug from Infracost Cloud (defaults to INFRACOST_ORG env var)
guardrailIdYesGuardrail ID to delete

Implementation Reference

  • Main handler function that executes the tool: validates args with DeleteGuardrailSchema, resolves orgSlug, calls cloud API client to delete guardrail, and returns MCP response.
    async handleDeleteGuardrail(args: z.infer<typeof DeleteGuardrailSchema>) { if (!this.cloudApiClient) { throw new Error('INFRACOST_SERVICE_TOKEN is not configured for Infracost Cloud API operations'); } const orgSlug = args.orgSlug || this.config.orgSlug; if (!orgSlug) { throw new Error('Organization slug is required. Provide it via orgSlug parameter or set INFRACOST_ORG environment variable'); } const { guardrailId } = args; const result = await this.cloudApiClient.deleteGuardrail(orgSlug, guardrailId); if (!result.success) { throw new Error(result.error || 'Delete guardrail request failed'); } return { content: [ { type: 'text', text: result.output || 'Guardrail deleted successfully', }, ], }; }
  • Zod input schema for the tool defining parameters: orgSlug (optional) and required guardrailId.
    export const DeleteGuardrailSchema = z.object({ orgSlug: z.string().optional().describe('Organization slug from Infracost Cloud (defaults to INFRACOST_ORG env var)'), guardrailId: z.string().describe('Guardrail ID to delete'), });
  • src/index.ts:774-777 (registration)
    Registration in callTool handler: parses args with schema and delegates to tools.handleDeleteGuardrail.
    case 'infracost_cloud_delete_guardrail': { const validatedArgs = DeleteGuardrailSchema.parse(args); return await tools.handleDeleteGuardrail(validatedArgs); }
  • src/index.ts:657-675 (registration)
    Tool registration in listTools response: includes name, description, and input schema.
    { name: 'infracost_cloud_delete_guardrail', description: 'Delete a guardrail from Infracost Cloud. Requires INFRACOST_SERVICE_TOKEN environment variable.', inputSchema: { type: 'object', properties: { orgSlug: { type: 'string', description: 'Organization slug from Infracost Cloud (defaults to INFRACOST_ORG env var)', }, guardrailId: { type: 'string', description: 'Guardrail ID to delete', }, }, required: ['guardrailId'], }, },
  • Supporting API client method that sends DELETE request to Infracost Cloud API endpoint /orgs/{orgSlug}/guardrails/{guardrailId}.
    async deleteGuardrail(orgSlug: string, guardrailId: string): Promise<CommandResult> { try { const response = await fetch( `${INFRACOST_CLOUD_API_BASE}/orgs/${orgSlug}/guardrails/${guardrailId}`, { method: 'DELETE', headers: { Authorization: `Bearer ${this.serviceToken}`, }, } ); if (!response.ok) { const errorText = await response.text(); return { success: false, error: `API request failed with status ${response.status}: ${errorText}`, }; } return { success: true, output: 'Guardrail deleted successfully', }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : 'Unknown error occurred', }; }

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/phildougherty/infracost_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server