Models

Pydantic models for MCP tool inputs and outputs.

class libtmux_mcp.models.SessionInfo
class libtmux_mcp.models.SessionInfo

Bases: BaseModel

Serialized tmux session.

class libtmux_mcp.models.WindowInfo
class libtmux_mcp.models.WindowInfo

Bases: BaseModel

Serialized tmux window.

class libtmux_mcp.models.PaneInfo
class libtmux_mcp.models.PaneInfo

Bases: BaseModel

Serialized tmux pane.

class libtmux_mcp.models.PaneContentMatch
class libtmux_mcp.models.PaneContentMatch

Bases: BaseModel

A pane whose captured content matched a search pattern.

class libtmux_mcp.models.ServerInfo
class libtmux_mcp.models.ServerInfo

Bases: BaseModel

Serialized tmux server info.

class libtmux_mcp.models.OptionResult
class libtmux_mcp.models.OptionResult

Bases: BaseModel

Result of a show_option call.

class libtmux_mcp.models.OptionSetResult
class libtmux_mcp.models.OptionSetResult

Bases: BaseModel

Result of a set_option call.

class libtmux_mcp.models.EnvironmentResult
class libtmux_mcp.models.EnvironmentResult

Bases: BaseModel

Result of a show_environment call.

class libtmux_mcp.models.EnvironmentSetResult
class libtmux_mcp.models.EnvironmentSetResult

Bases: BaseModel

Result of a set_environment call.

class libtmux_mcp.models.WaitForTextResult
class libtmux_mcp.models.WaitForTextResult

Bases: BaseModel

Result of a bounded wait for new pane output.

Deliberately free of inference. Every field is something the tool observed directly — a match, a clock reading, a tmux flag. There is no “likely cause”, no “next action”, no quiescence verdict: a confidently-wrong diagnosis costs the agent more than an honest “nothing appeared, here is what the pane shows”.

Field count is load-bearing. outputSchema is re-sent on every request of every session, so a field that no agent branches on is a permanent tax. outcome carries what three separate booleans carried before it.

class libtmux_mcp.models.CaptureSinceResult
class libtmux_mcp.models.CaptureSinceResult

Bases: BaseModel

Incremental pane capture result with an opaque resume cursor.

class libtmux_mcp.models.RunCommandResult
class libtmux_mcp.models.RunCommandResult

Bases: BaseModel

Result of running a shell command in a pane.

class libtmux_mcp.models.SendKeysOperation
class libtmux_mcp.models.SendKeysOperation

Bases: BaseModel

One raw-input operation for batch sending.

Used by send_keys_batch().

class libtmux_mcp.models.SendKeysOperationResult
class libtmux_mcp.models.SendKeysOperationResult

Bases: BaseModel

Per-operation result from batch sending.

Returned by send_keys_batch().

class libtmux_mcp.models.SendKeysBatchResult
class libtmux_mcp.models.SendKeysBatchResult

Bases: BaseModel

Structured result for a batch of raw-input send operations.

class libtmux_mcp.models.ToolCallOperation
class libtmux_mcp.models.ToolCallOperation

Bases: BaseModel

One nested MCP tool call for a batch wrapper.

class libtmux_mcp.models.ToolCallOperationResult
class libtmux_mcp.models.ToolCallOperationResult

Bases: BaseModel

Per-operation result from a generic MCP tool batch.

class libtmux_mcp.models.ToolCallBatchResult
class libtmux_mcp.models.ToolCallBatchResult

Bases: BaseModel

Structured result for a serial batch of MCP tool calls.

class libtmux_mcp.models.PaneSnapshot
class libtmux_mcp.models.PaneSnapshot

Bases: BaseModel

Rich screen capture with metadata: content, cursor, mode, and scroll state.

class libtmux_mcp.models.SearchPanesResult
class libtmux_mcp.models.SearchPanesResult

Bases: BaseModel

Paginated result of search_panes().

Wrapping the match list lets us surface bounded-output information that a bare list of PaneContentMatch rows cannot: whether pagination truncated the result set, which panes were skipped, and the offset/limit that produced this page. Agents can re-request with a higher offset to retrieve subsequent pages.

class libtmux_mcp.models.HookEntry
class libtmux_mcp.models.HookEntry

Bases: BaseModel

One entry in a tmux hook array.

Hooks like session-renamed are arrays — they can have multiple commands registered at sparse indices. HookEntry flattens one index+command pair into a serialisable row.

class libtmux_mcp.models.HookListResult
class libtmux_mcp.models.HookListResult

Bases: BaseModel

Structured result for hook introspection.

Returned by show_hooks() and show_hook(). Flat list of HookEntry instances so MCP clients can iterate without caring whether the underlying tmux hook is scalar or array-shaped.

class libtmux_mcp.models.BufferRef
class libtmux_mcp.models.BufferRef

Bases: BaseModel

Handle returned by load_buffer().

Agent-created tmux paste buffers are namespaced with a per-call UUID to avoid collisions on the server-global buffer namespace when concurrent agents (or parallel tool calls from a single agent) are staging content. Callers must use the buffer_name this model carries on subsequent paste_buffer(), show_buffer(), and delete_buffer() calls.

class libtmux_mcp.models.BufferContent
class libtmux_mcp.models.BufferContent

Bases: BaseModel

Structured result of show_buffer().