---
title: "Update env"
description: "Rename an env or set it as the user's default."
icon: material/pencil-outline
---

Rename an environment or make it the new default. Pass at least one of `name` or `is_default`; both are optional individually.

## :material-code-braces: Example

!!! tenx-ask "You"

    make `staging` the default

!!! tenx-answer "Log10x"

    Updated env `staging` (env_id `8c2b…`). It's now the default. The previous default `prod` has been un-defaulted.

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

The env_id of the target env, get it from [Login status](login-status.md) or a prior [Create env](create-env.md) response.

## :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",
      "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 update. Get it from `log10x_login_status` (which lists all envs with their env_ids) or from a prior `log10x_create_env` response."
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "New display name for the env. Optional, omit to keep the current name."
        },
        "is_default": {
          "type": "boolean",
          "description": "When true, this env becomes the user's default, every tool call without an explicit `environment` arg routes here. The previous default is automatically un-defaulted by the backend. Optional, omit to leave the default flag unchanged."
        }
      },
      "required": [
        "env_id"
      ],
      "additionalProperties": false
    }
    ```

    Source: [`src/tools/update-env.ts`](https://github.com/log-10x/log10x-mcp/blob/main/src/tools/update-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):

    > _Updated env 9e6f0a2b-...-c2: renamed "staging" → "staging-east"._

    ```json
    {
      "schema_version": "1.0",
      "schema_epoch": "2026-05-25",
      "tool": "log10x_update_env",
      "view": "summary",
      "summary": {
        "headline": "Updated env 9e6f0a2b-...-c2: renamed \"staging\" → \"staging-east\"."
      },
      "data": {
        "ok": true,
        "env_id": "9e6f0a2b-...-c2",
        "before": {
          "name": "staging",
          "is_default": false
        },
        "after": {
          "name": "staging-east",
          "is_default": false
        },
        "changes": [
          "renamed \"staging\" → \"staging-east\""
        ]
      },
      "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;
      env_id: string;
      before: { name: string; is_default: boolean };
      after: { name: string; is_default: boolean };
      changes: string[];
    }
    ```

    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).
