Skip to main content
Glama

delete_service_env

Remove environment variables from services in Coolify to manage configuration and maintain security by deleting sensitive or outdated data.

Instructions

Delete an environment variable from a service

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uuidYesService UUID
env_uuidYesEnvironment variable UUID

Implementation Reference

  • The core handler logic for the 'delete_service_env' tool within the main switch statement in handleTool. It validates required parameters (service uuid and env_uuid) and delegates the DELETE request to the CoolifyClient API endpoint /services/{uuid}/envs/{env_uuid}.
    case 'delete_service_env': requireParam(args, 'uuid'); requireParam(args, 'env_uuid'); return client.delete(`/services/${args.uuid}/envs/${args.env_uuid}`);
  • The tool definition including name, description, and input schema (JSON Schema) for 'delete_service_env'. This is used for MCP tool listing and validation.
    name: 'delete_service_env', description: 'Delete an environment variable from a service', inputSchema: { type: 'object', properties: { uuid: { type: 'string', description: 'Service UUID' }, env_uuid: { type: 'string', description: 'Environment variable UUID' } }, required: ['uuid', 'env_uuid'] }
  • src/index.ts:36-38 (registration)
    MCP server registration of all tools (including 'delete_service_env') via the ListToolsRequestHandler, which returns the definitions from getToolDefinitions() that includes this tool.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: getToolDefinitions() }));
  • src/index.ts:41-67 (registration)
    MCP server CallToolRequestHandler that dispatches to handleTool (which routes to the specific handler case for 'delete_service_env') after read-only checks.
    this.server.setRequestHandler(CallToolRequestSchema, async (request) => { if (!this.client) { throw new McpError(ErrorCode.InternalError, 'Client not initialized'); } const { name, arguments: args } = request.params; // Block write operations in read-only mode if (isReadOnlyMode() && !READ_ONLY_TOOLS.includes(name)) { throw new McpError( ErrorCode.InvalidRequest, `Operation '${name}' is not allowed in read-only mode. Set COOLIFY_READONLY=false to enable write operations.` ); } try { const result = await handleTool(this.client, name, args || {}); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error) { if (error instanceof McpError) throw error; const message = error instanceof Error ? error.message : 'Unknown error'; throw new McpError(ErrorCode.InternalError, `Tool execution failed: ${message}`); } });
  • Helper function used in the handler to validate and require specific parameters like 'uuid' and 'env_uuid'.
    function requireParam(args: ToolArgs, param: string): void { if (!args[param]) { throw new McpError(ErrorCode.InvalidParams, `${param} is required`); } }

Other 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/kof70/coolify-mcp-server'

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