Skip to main content
Glama

connect

Opens a serial port and starts a background reader to let you send commands and read responses from consoles, radios, and microcontrollers. Supports presets for common devices.

Instructions

Open a serial port and start its background reader.

Defaults are 9600 baud, 8 data bits, no parity, 1 stop bit, no flow control ("9600 8N1"), CR line ending, which is what most console/craft ports expect. Give preset (see list_presets) to load a device family's usual settings, and override any field explicitly, e.g. "38400 with XON/XOFF" -> baud=38400, xonxoff=True. Several ports can be open at once; each gets a name and later tools default to the most recently used one. Nothing is specific to telecom gear: any device on a serial port works, including IoT gateways, alarm and control panels, UPS and PDU menus and lab instruments; choose terminal by what the device prints.

Args: port: System port name, e.g. "COM4" (Windows), "/dev/cu.usbserial-10" (macOS), or "/dev/ttyUSB0" (Linux). Get exact names from list_serial_ports. preset: Device preset name such as "cisco-console", "juniper-craft", "kenwood-cat", "icom-civ", "yaesu-rotator", "arduino", "nmea-gps". name: Nickname for this connection ("rig", "rotator"). Defaults to the port's short name. Use it in other tools' connection argument. baud: Baud rate. Common values: 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200. Unknown? Use detect_baud first. bytesize: Data bits: 5, 6, 7, or 8. Almost always 8. parity: "N" none, "E" even, "O" odd. Almost always "N". stopbits: 1, 1.5, or 2. Almost always 1. rtscts: Hardware (RTS/CTS) flow control. Off unless the manual says so and the cable carries those lines. xonxoff: Software (XON/XOFF) flow control. Off by default. Never for binary protocols (it swallows 0x11 / 0x13 bytes). line_ending: Default line ending for send_text/query_text on this connection: "CR" (most rigs, consoles), "LF" (Unix, Arduino), "CRLF", or "NONE" (Kenwood-style CAT ending in ';'). prompt: Default prompt for read_until_prompt/query_text on this connection, e.g. "# ", "> ", ";" (CAT replies). Say what the device shows, with its trailing space. prompt_regex: Treat prompt as a regular expression. terminal: How to interpret what the device sends. "dumb" (default): raw bytes, right for CAT, CI-V, rotators and most CLIs. "ansi": strip colour/escape sequences and apply CR/backspace overwrites so shells and coloured prompts read cleanly (the console presets use it); prompts are also matched on the last line as displayed, so a line redrawn with spaces and backspaces (Junos after ? or Ctrl-U) still ends in its prompt. "vt100"/"xterm": additionally keep a real screen for full-screen menus, BIOS/BMC consoles, vi/top; read it with the screen tool, navigate with send_keys. cols: Screen width for vt100/xterm (default 80). rows: Screen height for vt100/xterm (default 24).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baudNo
colsNo
nameNo
portYes
rowsNo
parityNo
presetNo
promptNo
rtsctsNo
xonxoffNo
bytesizeNo
stopbitsNo
terminalNo
line_endingNo
prompt_regexNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed28 schema fields changedv0.3.2
    • addedInput schema / properties / baud / anyOf
      Added value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / baud / default
      Previous value: -9600New value: +null
    • removedInput schema / properties / baud / type
      Removed value: -"integer"
    • addedInput schema / properties / bytesize / anyOf
      Added value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / bytesize / default
      Previous value: -8New value: +null
    • removedInput schema / properties / bytesize / type
      Removed value: -"integer"
    • addedInput schema / properties / cols
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Cols"
      +}
    • addedInput schema / properties / line_ending
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "CR",
      +        "CRLF",
      +        "LF",
      +        "NONE"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Line Ending"
      +}
    • addedInput schema / properties / name
      Added value: +{
      +  "default": "",
      +  "title": "Name",
      +  "type": "string"
      +}
    • addedInput schema / properties / parity / anyOf
      Added value: +[
      +  {
      +    "enum": [
      +      "N",
      +      "E",
      +      "O"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / parity / default
      Previous value: -"N"New value: +null
    • removedInput schema / properties / parity / enum
      Removed value: -[
      -  "N",
      -  "E",
      -  "O"
      -]
    • removedInput schema / properties / parity / type
      Removed value: -"string"
    • addedInput schema / properties / preset
      Added value: +{
      +  "default": "",
      +  "title": "Preset",
      +  "type": "string"
      +}
    • addedInput schema / properties / prompt
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Prompt"
      +}
    • addedInput schema / properties / prompt_regex
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Prompt Regex"
      +}
    • addedInput schema / properties / rows
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Rows"
      +}
    • addedInput schema / properties / rtscts / anyOf
      Added value: +[
      +  {
      +    "type": "boolean"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / rtscts / default
      Previous value: -falseNew value: +null
    • removedInput schema / properties / rtscts / type
      Removed value: -"boolean"
    • addedInput schema / properties / stopbits / anyOf
      Added value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / stopbits / default
      Previous value: -1New value: +null
    • removedInput schema / properties / stopbits / type
      Removed value: -"number"
    • addedInput schema / properties / terminal
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "dumb",
      +        "ansi",
      +        "vt100",
      +        "xterm"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Terminal"
      +}
    • removedInput schema / properties / timeout
      Removed value: -{
      -  "default": 1,
      -  "title": "Timeout",
      -  "type": "number"
      -}
    • addedInput schema / properties / xonxoff / anyOf
      Added value: +[
      +  {
      +    "type": "boolean"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / xonxoff / default
      Previous value: -falseNew value: +null
    • removedInput schema / properties / xonxoff / type
      Removed value: -"boolean"
  2. First observedv0.1.0

TDQS

A5/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden, and it is exceptionally transparent: it discloses the background reader, default serial settings, multiple concurrent connections, MRU selection, flow-control caveats (e.g., XON/XOFF swallowing 0x11/0x13 bytes), and detailed terminal emulation behaviors.

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?

Although long, the length is justified by 15 parameters and complex serial semantics. The description front-loads the core action and defaults, then organizes parameters in a clear Args list where each sentence adds practical value.

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?

For a tool with this many parameters and no annotations, the description is complete: it covers defaults, parameter interdependencies, related tools, behavioral effects, and how connections are referenced later. Nothing an agent needs to open a port correctly is missing.

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

Parameters5/5

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

Schema description coverage is 0%, but the description documents every parameter with concrete values, defaults, platform examples, and caveats. For example, port names for Windows/macOS/Linux, common baud rates, and the semantics of terminal modes go far beyond the bare schema.

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?

The opening sentence states a specific verb and resource: 'Open a serial port and start its background reader.' It also distinguishes itself from sibling tools by explaining that this is the setup step for later send/read tools, and it explicitly broadens scope beyond telecom gear.

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?

The description gives concrete when-to-use guidance: get exact port names from list_serial_ports, load device settings via preset from list_presets, and use detect_baud when baud is unknown. It also explains how to choose terminal mode based on what the device prints, and how connection naming affects subsequent tools.

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