# show_environment

Source: https://libtmux.org/en/rs/latest/mcp/tools/show_environment/

> List the variables tmux hands to processes it starts, for the server or for one session, and whether each is set or marked for removal. Values are withheld: a tmux server inherits the environment of the shell that started it, tokens and keys included. A value is returned only for a name the operator listed in LIBTMUX_ENVIRONMENT_VALUES at startup, and is then returned in clear. This is not the environment of anything already running: a pane started before a change keeps what it was given. Read the tmux environment; accepts no client-supplied executable input. Values are withheld unless the operator allowed the name.

MCP is in development

Server behavior and tool contracts may change. Tool availability depends on the server configuration.

List the variables tmux hands to processes it starts, for the server or for one session, and whether each is set or marked for removal. Values are withheld: a tmux server inherits the environment of the shell that started it, tokens and keys included. A value is returned only for a name the operator listed in LIBTMUX_ENVIRONMENT_VALUES at startup, and is then returned in clear. This is not the environment of anything already running: a pane started before a change keeps what it was given. Read the tmux environment; accepts no client-supplied executable input. Values are withheld unless the operator allowed the name.

[All Rust tools](https://libtmux.org/en/rs/latest/mcp/tools/) · [JSON](https://libtmux.org/en/rs/latest/mcp/tools/show_environment.json) · [Source](https://github.com/libtmux/libtmux-rs/blob/2cef1aa642182dd1970c3688feb6a568ff666e64/crates/tmux-mcp/src/tools/inspect.rs#L510)

## Arguments

* `session` optional · string | null

  The session whose environment to read, by \`$\`-prefixed id or name. Omit for the server's own.

## Schemas

The schema defines required fields, nested values, defaults, and validation constraints.

Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "session": {
      "description": "The session whose environment to read, by `$`-prefixed id or name.\n\nOmit for the server's own.",
      "type": [
        "string",
        "null"
      ]
    }
  },
  "type": "object"
}
```

Output schema

```json
{
  "$defs": {
    "EnvironmentEntry": {
      "description": "One tmux environment entry.",
      "properties": {
        "name": {
          "description": "The variable name.",
          "type": "string"
        },
        "state": {
          "$ref": "#/$defs/EnvironmentState",
          "description": "Whether the name holds a value or is marked for removal."
        },
        "value": {
          "description": "The value, only for a set variable whose name the operator allowed in\n`LIBTMUX_ENVIRONMENT_VALUES` at startup.",
          "type": [
            "string",
            "null"
          ]
        },
        "withheld": {
          "description": "True for a set variable whose value was not returned because the\noperator did not allow its name.",
          "type": "boolean"
        }
      },
      "required": [
        "name",
        "state",
        "withheld"
      ],
      "type": "object"
    },
    "EnvironmentState": {
      "description": "What tmux holds under one environment name.",
      "oneOf": [
        {
          "const": "set",
          "description": "tmux holds a value and hands it to processes it starts.",
          "type": "string"
        },
        {
          "const": "removed",
          "description": "tmux removes the name from the environment of processes it starts.",
          "type": "string"
        }
      ]
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "entries": {
      "description": "The entries, in tmux's own order.",
      "items": {
        "$ref": "#/$defs/EnvironmentEntry"
      },
      "type": "array"
    },
    "session": {
      "description": "The session the environment belongs to, or absent for the server's.",
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "entries"
  ],
  "type": "object"
}
```

Tool annotations

```json
{
  "destructiveHint": false,
  "idempotentHint": true,
  "openWorldHint": false,
  "readOnlyHint": true,
  "title": "Show tmux Environment"
}
```
