Skip to main content
Glama

Close test clients

instances_close
Destructive

Closes clients launched by this bridge session at once without saving their config, using instance IDs, PIDs, or owner labels; clients from other sessions or games are refused.

Instructions

Closes clients this session started with instances_launch, at once and without writing their config, by instance id, by pid (also for a client that never answered, e.g. gmod-mcp did not load in it) or by owner label. By id, pid or all, only this bridge session's clients: other games (the user's own, another session's) are refused, close those only if the user asks, with game_terminate. By owner label it also closes keep: true test clients of an earlier session (a bridge restarted, another agent) that carry that label (instances_list shows it as owner; closed[i].launched_by_other_session is true), but never a game that is not a test client or one without the tag. Sub-agents of one Claude Code session share it: all: true closes their clients too. The selectors add up (instances, pids, owner). Result: {closed: [{pid, instance?, owner?}], already_gone?: [{pid, instance?, owner?}] (processes that had ended before the call: nothing was closed), refused?: [ids, pids or "owner:" not started by this session or already closed], why_refused?}; an error (code refused, the same fields beside it) only when nothing was closed. Closing the client that is the coordinator (the game on the base port, see instances_list: role, coordinator_warning) while other games live moves that role: the answer says so (closed[i].was_coordinator, coordinator_moved_to, warning) and calls of other agents answer coordinator_changing for a few seconds. Example: {"owner": "fork-a"}.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "instances_close"
  }
}

Input Schema

NameRequiredDescriptionDefault
allNoClose every client this session started, other sub-agents' included.
pidsNoProcess ids to close (as returned by instances_launch).
ownerNoClose every client launched with this owner label, including keep: true test clients of an earlier bridge session that carry it.
instancesNoInstance ids to close.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.7

TDQS

A4.5/5.0
Behavior4/5

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

Goes well beyond the destructiveHint=true annotation: clients are closed 'without writing their config', refusal rules are spelled out, an error is returned only when nothing was closed, and closing a coordinator moves that role and yields coordinator_changing for other agents for a few seconds. The one gap is timing/termination behavior (graceful vs. forced kill), which is never stated.

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

Conciseness3/5

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

Purpose is front-loaded and little is pure filler, but the body is a single sprawling paragraph of long sentences with nested parentheticals (e.g. the refused/already_gone sentence), which slows an agent trying to extract the refusal rules. Grouping selectors, return shape, and coordinator behavior into separate blocks would cost nothing and read far better.

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

Completeness5/5

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

With no output schema, the description carries the full return contract: closed/already_gone/refused arrays, why_refused, the error-only-when-nothing-closed rule, and the coordinator fields (was_coordinator, coordinator_moved_to, warning). Nothing an agent needs in order to call this correctly and interpret the result is missing.

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 100%, so baseline is 3, but the description adds real meaning: pids work even for a client that never answered, owner reaches earlier-session keep: true clients, and the selectors combine rather than override. Only the `all` interaction with explicit selectors is slightly implicit.

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: 'Closes clients this session started with instances_launch', and immediately names the accepted selectors (id, pid, owner label). It also distinguishes itself from game_terminate for non-test games, so an agent can tell the two apart without opening either schema.

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

Usage Guidelines5/5

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

Explicit about when-not-to-use: other games and other sessions' clients are 'refused, close those only if the user asks, with game_terminate'. It also explains the owner-label exception (keep: true clients from an earlier session) and that all: true extends to sub-agents' clients, plus that selectors add up.

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