Skip to main content
Glama

Close a terminal session

terminal_close
DestructiveIdempotent

Terminate a terminal session and remove it from the session list, stopping any child processes running in its process group. Use it to clean up sessions and prevent orphaned processes.

Instructions

Terminate a session and remove it from the session list. Running child processes in its process group are stopped too.

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": {
      "id": "<id>"
    },
    "name": "terminal_close"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesSession id (for example "term_1a2b3c4d") or the friendly name given at spawn time.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, but the description adds real value beyond them by naming the two side effects an agent must anticipate: removal from the session list and termination of running child processes in the process group.

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?

Two sentences, front-loaded with the primary action and followed immediately by the consequential side effect; nothing is redundant with the title or restates the name.

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?

For a one-parameter teardown tool with rich annotations and no output schema, the description covers both the state change and the process-level consequence. It stops short of stating error behavior for an unknown or already-closed id, which would complete the picture.

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

Parameters3/5

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

Schema coverage is 100% and the single `id` parameter is already documented with format and friendly-name alternates in the schema, so the description adds no parameter meaning beyond it; baseline 3 applies.

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 ("Terminate a session and remove it from the session list") and implicitly distinguishes itself from siblings like terminal_spawn, terminal_exec, and terminal_list by describing teardown rather than creation, execution, or enumeration.

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

Usage Guidelines3/5

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

Usage is only implied by the destructive wording; the description never says when to close versus when terminal_signal or terminal_write is the better choice, nor does it note prerequisites such as the session being idle or the caller's ownership of it.

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