Skip to main content
Glama

Close a surface or workspace

cmux_close

Closes a terminal surface, tab, or workspace, including a pane's selected surface; safely previews and requires confirm=true to close the calling pane's own workspace.

Instructions

Close a surface (tab) or an entire workspace. For kind "surface" a pane ref also works (closes that pane's selected surface). For kind "workspace", ref "current" safely closes the CALLING pane's own workspace (never the UI-focused one) — first call previews it, call again with confirm=true to close.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "kind": "<kind>",
      "ref": "<ref>"
    },
    "name": "cmux_close"
  }
}

Input Schema

NameRequiredDescriptionDefault
refYese.g. "surface:40" or "workspace:26". Kind "surface" also accepts a pane ref like "pane:7". Kind "workspace" also accepts "current" for the calling pane's own workspace (requires confirm=true).
kindYes
confirmNoRequired true when ref is "current"; ignored otherwise.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.13

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations supplied, the description carries the full burden and does add real behavioral context: the 'current' target deliberately resolves to the calling pane rather than the focused one, and closing is gated by a two-step preview/confirm flow. It does not disclose irreversibility, what happens to running processes or child panes, or error conditions, which are the main remaining gaps for a destructive operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the primary action, then the two mode-specific caveats. The parenthetical clauses are dense but each carries distinct operational information; nothing is redundant filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive tool with no annotations and no output schema, the definition covers targeting and confirmation well but leaves out consequences (what is destroyed, whether it can be undone), failure modes, and what the preview response looks like. Adequate to call correctly, not complete enough to call safely with confidence.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 67% and the description adds meaning the schema does not: the preview-then-confirm protocol for confirm=true is only explained in prose, and it clarifies that a pane ref is a valid substitute ref for kind 'surface'. Some content (pane ref acceptance, 'current') overlaps the schema, keeping it below a 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Close a surface (tab) or an entire workspace') and immediately enumerates the two operating modes via the kind enum, so an agent can tell exactly what the tool acts on. It also clarifies the surface/pane relationship, which is non-obvious from the name.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete guidance for the tricky case: when kind is 'workspace' and ref is 'current', the tool targets the calling pane's own workspace, never the UI-focused one, and requires a preview-then-confirm sequence. It does not state when to prefer this over other lifecycle tools or what preconditions (e.g. unsaved work) should block a close, so it stops short of explicit when-not guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.