Skip to main content
Glama

liara_delete_env_var

Remove environment variables from applications on the Liara cloud platform to manage configuration settings.

Instructions

Delete/unset an environment variable for an app

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appNameYesThe name of the app
keyYesVariable name to delete

Implementation Reference

  • The core handler function that deletes a single environment variable for a Liara app by wrapping deleteEnvVars.
    export async function deleteEnvVar(
        client: LiaraClient,
        appName: string,
        key: string
    ): Promise<{ message: string }> {
        return await deleteEnvVars(client, appName, [key]);
    }
  • Supporting function that implements the deletion logic by fetching current env vars, filtering out the specified keys, and updating via API.
    export async function deleteEnvVars(
        client: LiaraClient,
        appName: string,
        keys: string[]
    ): Promise<{ message: string }> {
        validateAppName(appName);
        validateRequired(keys, 'Environment variable keys');
        
        if (keys.length === 0) {
            throw new Error('At least one environment variable key is required');
        }
    
        // Get current env vars
        const currentVars = await getEnvVars(client, appName);
        
        // Filter out the keys to delete
        const updatedVars = currentVars.filter(v => !keys.includes(v.key));
        
        // Update with remaining vars
        const request: UpdateEnvsRequest = {
            project: appName,
            variables: updatedVars,
        };
    
        return await client.post<{ message: string }>('/v1/projects/update-envs', request);
    }
  • Helper function to retrieve all current environment variables for an app, used in deletion to preserve others.
    export async function getEnvVars(
        client: LiaraClient,
        appName: string
    ): Promise<EnvironmentVariable[]> {
        validateAppName(appName);
        try {
            const project = await client.get<{
                envs?: Array<{ key?: string; name?: string; value?: string }>;
                envVars?: Array<{ key?: string; name?: string; value?: string }>;
                project?: { envs?: Array<{ key?: string; name?: string; value?: string }> };
            }>(`/v1/projects/${appName}`);
            // API returns 'envs' array in project object
            const envs = project.envs || project.envVars || project.project?.envs || [];
            // Map to EnvironmentVariable format (extract key and value)
            return envs.map((env) => ({
                key: env.key || env.name || '',
                value: env.value || '',
            }));
        } catch (error: unknown) {
            const err = error as { statusCode?: number };
            if (err.statusCode === 404) {
                const { LiaraMcpError } = await import('../utils/errors.js');
                throw new LiaraMcpError(
                    `App "${appName}" not found`,
                    'APP_NOT_FOUND',
                    { appName },
                    [
                        'Check if the app name is correct',
                        'Use liara_list_apps to see all available apps',
                        'Verify you have access to this app'
                    ]
                );
            }
            throw error;
        }
    }
  • Type definition for environment variables used in API requests and responses.
    export interface EnvironmentVariable {
        key: string;
        value: string;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action is a deletion/unset, implying a destructive mutation, but lacks critical details: whether it requires specific permissions, if the change is immediate or reversible, potential impacts on the app (e.g., downtime), or error conditions. This leaves significant gaps for safe agent operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words, front-loading the core action. It's appropriately sized for a simple deletion tool, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive mutation tool with no annotations and no output schema, the description is incomplete. It lacks information on behavioral traits (e.g., side effects, auth needs), output format (e.g., success confirmation or error details), and usage context compared to siblings. This could lead to misuse or uncertainty in agent decisions.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with clear parameter descriptions in the schema (appName and key). The description adds no additional semantic context beyond implying these parameters are needed, so it meets the baseline of 3 where the schema does the heavy lifting without extra value from the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'delete/unset' and the resource 'environment variable for an app', making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like liara_delete_env_vars (plural) or liara_set_env_var, which could cause confusion about scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing app or variable), compare it to liara_delete_env_vars (bulk deletion) or liara_set_env_var (creation/update), or indicate any constraints like permissions or effects on the app.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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/razavioo/liara-mcp'

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