Skip to main content
Glama

close_device

Idempotent

Closes an open CAN device session by stopping periodic TX and monitoring, then shuts the bus; the alias stays in config for later reopening.

Instructions

Close one open session: stop periodic TX and monitor, then shut the bus.

    Success data is {state: "closed"} and the alias stays in config for a later
    open_device. Does not send frames and does not delete the device entry.
    If a periodic task fails to stop, the session stays in error and is kept
    so you can retry; it is not removed. Closing an alias that is not open
    returns SESSION_NOT_FOUND.
    

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": {
      "device": "<device>"
    },
    "name": "close_device"
  }
}

Input Schema

NameRequiredDescriptionDefault
deviceYesDevice alias from config / list_devices

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.4
    • addedInput schema / properties / device / description
      Added value: +"Device alias from config / list_devices"
  2. First observedv0.1.3

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare readOnly=false, idempotent=true, openWorld=true, destructive=false; the description goes well beyond by spelling out the side effects (stop periodic TX and monitor, shut the bus), what is explicitly NOT done (no frames sent, device entry not deleted), and the error path (a periodic task that fails to stop leaves the session in error and kept for retry). The SESSION_NOT_FOUND outcome is a concrete, actionable disclosure absent from annotations.

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?

Effects, negative guarantees, error handling, and the success marker are front-loaded and each sentence carries information. Slight redundancy between "does not delete the device entry" and "it is not removed", and the embedded whitespace/line breaks make it less scannable than it could be.

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?

Though an output schema exists, the explicit success payload {state: "closed"} plus the error case and retry semantics give an agent everything needed to call this correctly and interpret both outcomes. For a one-parameter mutation tool, nothing material 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% and the single `device` parameter is already documented as "Device alias from config / list_devices". The description adds meaning by clarifying that the alias must refer to a currently open session and that the alias persists in config afterwards, which tells the agent what to pass and what survival semantics to expect.

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?

"Close one open session: stop periodic TX and monitor, then shut the bus" names a specific verb, resource, scope, and the internal sequence of effects. The contrast with open_device ("alias stays in config for a later open_device") and with device deletion ("does not delete the device entry") makes the boundary against siblings clear.

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?

It states the operational context (close a currently open session) and the failure condition (closing a non-open alias returns SESSION_NOT_FOUND), and points to open_device for reopening. What's missing is an explicit when-not, e.g. which sibling to use for stopping only periodic tasks without closing the bus (periodic_stop exists) – that routing decision is left implicit.

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