Skip to main content
Glama

connect_device

Connects to a specified J-Link debugger or the first available device, using optional serial number, SWD/JTAG interface, and target chip name for STM32 debugging and firmware flashing.

Instructions

Connect to JLink device / 连接到 JLink 设备.

Connects to the specified JLink debugger. If no serial number is specified, connects to the first available device. 连接到指定的 JLink 调试器。如果不指定序列号,则连接第一个可用设备。

Args: serial_number: Device serial number (optional) / 设备序列号(可选) interface: Target interface type (SWD/JTAG, optional, defaults to runtime config) / 目标接口类型(SWD/JTAG,可选,默认取运行时配置) chip_name: Target chip name (e.g., STM32F407VG, optional) / 目标芯片名称(如 STM32F407VG,可选)

Returns: Connection result / 连接结果

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": "connect_device"
  }
}

Input Schema

NameRequiredDescriptionDefault
chip_nameNo
interfaceNo
serial_numberNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It usefully discloses two behavioral defaults — unset serial_number selects the first device, and unset interface falls back to runtime config — but says nothing about permissions, whether connecting alters target state (halt/reset), or what happens on an already-open connection.

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?

Structure is clear and front-loaded with the action and fallback behavior, but the full English/Chinese duplication roughly doubles length without adding information, and the 'Returns: Connection result' line is redundant given the output schema exists.

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 zero-required-parameter hardware connection tool with an output schema covering return values and no annotations, the description covers purpose, all three parameters, and defaulting behavior well. The missing piece is preconditions/error behavior for connection failures or duplicates.

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 description coverage is 0%, so the description must compensate and largely does: it explains all three parameters, gives the acceptable interface values (SWD/JTAG), notes optionality and the runtime-config default, and provides a concrete example format for chip_name (STM32F407VG). Minor gap: no serial number format or discovery hint.

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 and resource ('Connect to JLink device') and names the debugger it targets, plus the key scoping behavior (first available device when no serial is given). It does not explicitly name siblings such as list_jlink_devices or disconnect_device, so the agent must infer the pairing, but the action itself 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 Guidelines3/5

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

There is implied usage context: call it to establish a debugger connection, and omitting serial_number picks the first available device. However, it never says what to do first (e.g., enumerate with list_jlink_devices), what to do if already connected, or when to prefer another connection path.

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