Skip to main content
Glama

close_surface

Destructive

Close a surface, agent, or workspace while protecting live agents. Use force to override, and get separate status for agent stop and surface close.

Instructions

Close one surface, managed agent, or workspace with live-agent guards. scope="agent" stops the agent AND closes its pane, and reports the two halves separately (agent_stopped, surface_closed) so a pane that survives is never reported as closed. The pane close obeys the same live-agent guard as scope="surface": without force:true a still-live agent keeps its pane, and the receipt says so.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNoClose even when the backing agent is still live (not done/error). This never bypasses stable surface identity checks. Without force, a live agent's surface is protected and the response returns the current pane contents instead of closing.
scopeNosurface
surfaceNoTarget surface ref
agent_idNoManaged agent ID
workspaceNoTarget workspace ref

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
paneNo
forceNo
scopeNo
stateNo
agentsNo
refusedNo
removedNo
surfaceNo
agent_idNo
surfacesNo
workspaceNo
live_agentsNo
retry_countYes
collapse_paneNo
caller_workspaceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.4.88
    • addedInput schema / properties / agent_id
      Added value: +{
      +  "description": "Managed agent ID",
      +  "type": "string"
      +}
    • addedInput schema / properties / force
      Added value: +{
      +  "default": false,
      +  "description": "Close even when the backing agent is still live (not done/error). This never bypasses stable surface identity checks. Without force, a live agent's surface is protected and the response returns the current pane contents instead of closing.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / scope
      Added value: +{
      +  "default": "surface",
      +  "enum": [
      +    "surface",
      +    "agent",
      +    "workspace"
      +  ],
      +  "type": "string"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "surface"
      -]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": true,
      +  "properties": {
      +    "agent_id": {
      +      "type": "string"
      +    },
      +    "agents": {
      +      "items": {
      +        "additionalProperties": {},
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "caller_workspace": {
      +      "type": "boolean"
      +    },
      +    "collapse_pane": {
      +      "type": "boolean"
      +    },
      +    "force": {
      +      "type": "boolean"
      +    },
      +    "live_agents": {
      +      "items": {
      +        "additionalProperties": {},
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "ok": {
      +      "type": "boolean"
      +    },
      +    "pane": {
      +      "type": "string"
      +    },
      +    "refused": {
      +      "type": "boolean"
      +    },
      +    "removed": {
      +      "additionalProperties": {},
      +      "type": "object"
      +    },
      +    "retry_count": {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "scope": {
      +      "enum": [
      +        "surface",
      +        "agent",
      +        "workspace"
      +      ],
      +      "type": "string"
      +    },
      +    "state": {
      +      "type": "string"
      +    },
      +    "surface": {
      +      "type": "string"
      +    },
      +    "surfaces": {
      +      "items": {
      +        "additionalProperties": {},
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "workspace": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "ok",
      +    "retry_count"
      +  ],
      +  "type": "object"
      +}
  2. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already convey destructiveness, and the description adds meaningful context: scope='agent' stops the agent, closes its pane, reports the two results separately, and the pane close is guarded exactly like scope='surface'. It does not, however, disclose what closing a workspace does to contained surfaces or agents, which is a notable gap for a destructive tool.

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

Conciseness5/5

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

Three sentences with no filler. The core purpose is front-loaded, and each subsequent sentence adds a distinct behavioral edge case or guard rule that an agent needs to invoke the tool correctly.

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

Completeness4/5

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

Surface and agent scopes are well covered, including guard behavior and partial-failure reporting, and the output schema covers return shape. The workspace scope is only named without explaining whether closing cascades to contained surfaces/agents or how the live-agent guard applies, which is important for a destructive operation.

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 80%, so most parameters are already documented. The description adds real value by explaining the otherwise-undocumented scope enum, the force/guard interaction, and the split agent_stopped/surface_closed reporting.

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?

The opening sentence states a specific verb ('Close') and explicit object types ('surface, managed agent, or workspace') plus the operative guard. This is unambiguous and easily distinguished from sibling tools like list_surfaces, update_surface, and spawn_agent.

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?

The description gives clear conditional usage for scope='agent' versus scope='surface' and explains when force:true is or isn't needed. It does not explicitly name alternatives or say 'use this instead of X', but no sibling performs closing, so the intended use is clear.

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