Skip to main content
Glama

bridge_close_session

DestructiveIdempotent

Terminate a session and clean up temporary Git worktrees, optionally deleting the worktree folder, to clear leftover task state and reclaim disk space.

Instructions

Close a session and clean up temporary worktrees.

Args: session_id: Session ID to terminate. repo_root: Path to target repository. cleanup_worktree: Whether to remove the worktree folder on disk (default: True).

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": {
      "session_id": "<session_id>"
    },
    "name": "bridge_close_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
repo_rootNo
session_idYes
cleanup_worktreeNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.1

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, idempotentHint=true, and readOnlyHint=false, so the safety profile is covered. The description adds useful specifics beyond that: it names what is destroyed (the worktree folder on disk) and that cleanup is on by default. It does not state consequences for the session's state, running tasks, or irreversibility beyond the hint.

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?

Front-loaded one-sentence summary followed by an Args block; efficient and easy to scan. The conventional Python-docstring formatting is slightly noisy but not wasteful.

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?

An output schema exists, so return values needn't be explained, and the description covers the mutation and its on-disk side effect, which is the key risk. What is missing is any note on interaction with active sessions or sibling cancel/close tools.

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 description coverage is 0%, so the description itself must carry parameter meaning. It does document all three args with the default for cleanup_worktree, but repo_root is only described as 'Path to target repository' with no note that it is optional or what happens when omitted.

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

Purpose4/5

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

States a specific verb+resource ('Close a session') plus a secondary action ('clean up temporary worktrees'), distinguishing it from siblings like bridge_get_session or bridge_cancel_session by the terminal cleanup semantics. No explicit sibling differentiation, but the purpose is unambiguous.

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

Usage Guidelines2/5

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

No guidance on when to use this versus bridge_cancel_session, which is the natural alternative an agent would consider. Nothing says whether closing is terminal, whether an active session can be closed, or what preconditions must hold.

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