set_environment
- set_environment( name: string, session_id?: string | null, session_name?: string | null, socket_name?: string | null, value: string, )
-
Set a tmux environment variable.
Use to set variables that will be inherited by new panes and windows. Changes do not affect already-running processes.
Some variables control later shell execution. Bash sources the file named by
BASH_ENV, POSIX shells may source the file named byENV, and Bash evaluatesPROMPT_COMMANDbefore displaying a prompt.- MCP request method
tools/callSendset_environmentas the tool name, with the arguments below.- Wraps
libtmux.common.EnvironmentMixin.set_environmentThe library call this tool makes:src/libtmux_mcp/tools/env_tools.py:118.
Arguments
-
Environment variable name.
-
session_id? =null(string | null)Session ID to set environment for.
-
session_name? =null(string | null)Session name to set environment for.
-
socket_name? =null(string | null)tmux socket name.
-
Environment variable value.
No other arguments are accepted.
Result
Returns object
Annotations
Advertised by the server
destructiveHinttrueidempotentHintfalseopenWorldHinttruereadOnlyHintfalse
Capability
- Toolset
- Execute Start or drive pane processes, or store state that can control later execution.
Every Python tool advertises the same annotations, so a host that approves by annotation cannot tell tools apart. The capability row is what tells them apart.
Protocol data
Use the complete advertised contract for validation and client integration.
Input schema
{"additionalProperties": false,"properties": {"name": {"description": "Environment variable name.","type": "string"},"session_id": {"anyOf": [{"type": "string"},{"type": "null"}],"default": null,"description": "Session ID to set environment for."},"session_name": {"anyOf": [{"type": "string"},{"type": "null"}],"default": null,"description": "Session name to set environment for."},"socket_name": {"anyOf": [{"type": "string"},{"type": "null"}],"default": null,"description": "tmux socket name."},"value": {"description": "Environment variable value.","type": "string"}},"required": ["name","value"],"type": "object"}Output schema
{"description": "Result of a set_environment call.","properties": {"name": {"description": "Variable name","type": "string"},"status": {"description": "Operation status","type": "string"},"value": {"description": "Value that was set","type": "string"}},"required": ["name","value","status"],"type": "object"}