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

get_session_info

get_session_info( session: string, )

Inspect tmux metadata; accepts no client-supplied executable input. Return metadata for one session without listing every session.

MCP request method
tools/call Send get_session_info as the tool name, with the arguments below.

Arguments

Result

Returns object

  • session (object)

    • attachedClients (integer)

      Raw client count from tmux; 0 means detached. Includes control-mode clients - this server’s own wait_for_text or other live read holds one open while it runs, and another program on this socket may hold others. See humanAttachedClients for a person-only count.

      minimum
      -9007199254740991
      maximum
      9007199254740991
    • humanAttachedClients (integer)

      attachedClients minus every control-mode client, this server’s own included.

      minimum
      -9007199254740991
      maximum
      9007199254740991
    • id (string)

      Stable session id, e.g. $1.

      pattern
      "^\\$\\d+$"
    • metadataComplete (boolean)

      Whether the session name is complete.

    • name (string)

    • omittedMetadataBytes (integer)

      UTF-8 bytes omitted from the session name.

      minimum
      0
      maximum
      9007199254740991
    • windows (integer)

      How many windows it holds.

      minimum
      -9007199254740991
      maximum
      9007199254740991

    No other properties are accepted.

No other properties are accepted.

Annotations

Advertised by the server

destructiveHint
true
idempotentHint
false
openWorldHint
true
readOnlyHint
false

Capability

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

Every TypeScript 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
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"session": {
"description": "Session id ($1) or name.",
"type": "string"
}
},
"required": [
"session"
],
"type": "object"
}
Output schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"session": {
"additionalProperties": false,
"properties": {
"attachedClients": {
"description": "Raw client count from tmux; 0 means detached. Includes control-mode clients - this server's own wait_for_text or other live read holds one open while it runs, and another program on this socket may hold others. See humanAttachedClients for a person-only count.",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
},
"humanAttachedClients": {
"description": "attachedClients minus every control-mode client, this server's own included.",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
},
"id": {
"description": "Stable session id, e.g. $1.",
"pattern": "^\\$\\d+$",
"type": "string"
},
"metadataComplete": {
"description": "Whether the session name is complete.",
"type": "boolean"
},
"name": {
"type": "string"
},
"omittedMetadataBytes": {
"description": "UTF-8 bytes omitted from the session name.",
"maximum": 9007199254740991,
"minimum": 0,
"type": "integer"
},
"windows": {
"description": "How many windows it holds.",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
}
},
"required": [
"attachedClients",
"humanAttachedClients",
"id",
"metadataComplete",
"name",
"omittedMetadataBytes",
"windows"
],
"type": "object"
}
},
"required": [
"session"
],
"type": "object"
}
Esc
Search in

Type to search.

Reference previewOpen reference