MCPconceptTools

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

MoreLess about this notice

Concept example A working example of the core library. It can change without notice. What concept means

tool MCP

show_environment

show_environment( session?: string | null, )

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 request method
tools/call Send show_environment as the tool name, with the arguments below.

Arguments

  • session? (string | null)

    The session whose environment to read, by $-prefixed id or name.

    Omit for the server’s own.

No other arguments are accepted.

Result

Returns object

Types

EnvironmentEntry: object

type

One tmux environment entry.

  • name (string)

    The variable name.

  • state (EnvironmentState)

    Whether the name holds a value or is marked for removal.

  • value (string | null)

    The value, only for a set variable whose name the operator allowed in LIBTMUX_ENVIRONMENT_VALUES at startup.

  • withheld (boolean)

    True for a set variable whose value was not returned because the operator did not allow its name.

EnvironmentState: "set" | "removed"

type

What tmux holds under one environment name.

Matches exactly one variant.

  • Variant 1 ("set")

    tmux holds a value and hands it to processes it starts.

  • Variant 2 ("removed")

    tmux removes the name from the environment of processes it starts.

Annotations

Advertised by the server

destructiveHint
false
idempotentHint
true
openWorldHint
false
readOnlyHint
true
title
"Show tmux Environment"

Capability

Toolset
Inspect Request tmux state and terminal output.
Process reach
none
tmux effects
observe

The capability row states what this tool reads, changes and reaches; the annotations are as the server advertises them.

Protocol data

Use the complete advertised contract for validation and client integration.

Input schema
{
"$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
{
"$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",
"value",
"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",
"session"
],
"type": "object"
}
Esc
Search in

Type to search.

Reference previewOpen reference