---
title: "Delete env"
description: "Remove an environment from your Log10x account. Irrecoverable. Confirm-name guarded."
icon: material/delete-outline
---

Destructive: removes an environment from your Log10x account. Irrecoverable.

The tool requires a `confirm_name` matching the env's exact display name (case-sensitive), same pattern as `gh repo delete`. If the name doesn't match, the tool refuses without calling the backend and shows the correct name so the agent can re-confirm with you.

## :material-code-braces: Example

!!! tenx-ask "You"

    delete the `old-poc` env

!!! tenx-answer "Log10x"

    Confirm by typing the exact name to delete:

    ```
    delete_env(env_id="a4f2…", confirm_name="old-poc")
    ```

    This cannot be undone.

## :material-check-decagram-outline: Prerequisites

The env_id of the target env, get it from [Login status](login-status.md).

## :material-code-json: Schema and samples

??? tenx-input-example "Input example"

    Real call against the demo env (captured by [`scripts/capture-tool-envelopes.mjs`](https://github.com/log-10x/log10x-mcp/blob/main/scripts/capture-tool-envelopes.mjs)).

    ```json
    {
      "env_id": "9e6f0a2b-...-c2",
      "confirm_name": "staging-east"
    }
    ```

??? tenx-input-schema "Input schema"

    Agent-facing JSON Schema (the canonical shape the MCP server publishes via `tools/list`):

    ```json
    {
      "type": "object",
      "properties": {
        "env_id": {
          "type": "string",
          "minLength": 1,
          "description": "The `env_id` UUID of the environment to delete. Get it from `log10x_login_status` (which lists all envs with their env_ids)."
        },
        "confirm_name": {
          "type": "string",
          "minLength": 1,
          "description": "The exact display name of the env being deleted. Must match the current `name` (case-sensitive). This is a typo-prevention guard: if it does not match, the tool refuses without calling the backend, and shows the correct name so the LLM can confirm with the user before retrying."
        }
      },
      "required": [
        "env_id",
        "confirm_name"
      ],
      "additionalProperties": false
    }
    ```

    Source: [`src/tools/delete-env.ts`](https://github.com/log-10x/log10x-mcp/blob/main/src/tools/delete-env.ts).

??? tenx-output-example "Output example"

    Real envelope from the demo env. `view: "summary"` returns the full `StructuredOutput` with typed `data`. Long arrays + base64 PNG bodies trimmed for readability; the real call returns them in full.

    Headline (the 1-line agent-facing answer):

    > _Deleted env "staging-east" (9e6f0a2b-...-c2), 1 envs remain._

    ```json
    {
      "schema_version": "1.0",
      "schema_epoch": "2026-05-25",
      "tool": "log10x_delete_env",
      "view": "summary",
      "summary": {
        "headline": "Deleted env \"staging-east\" (9e6f0a2b-...-c2), 1 envs remain."
      },
      "data": {
        "ok": true,
        "deleted_env_id": "9e6f0a2b-...-c2",
        "deleted_name": "staging-east",
        "remaining_envs": 1
      },
      "warnings": [
        "env deletion is irrecoverable; metric history scoped to this env is also lost"
      ],
      "generated_at": "2026-05-26T00:00:00.000Z"
    }
    ```

??? tenx-output-schema "Output schema"

    The `data` block inside the [StructuredOutput envelope](../index.md#json-by-default-output):

    ```typescript
    interface ToolData {
      ok: boolean;
      deleted_env_id: string;
      deleted_name: string;
      remaining_envs: number;
    }
    ```

    Envelope-level fields the agent should also read: `summary.headline` (1-line answer), `actions[]` (next-call chain hints as `{tool, args, reason}`), `truncated: boolean`, `images[]` (PNG attachments where applicable), `schema_epoch` (engine-ID stability boundary).
