Skip to main content
Glama

nRF52 Flash UF2

nrf52_flash_uf2
Destructive

Flashes an nRF52 board by copying a .uf2 file to its bootloader UF2 drive, validating the image and SoftDevice and requiring confirmation; use after entering UF2 mode.

Instructions

Flash an nRF52 board by copying a .uf2 onto its bootloader UF2 drive.

Several times faster than serial DFU, and no touch or DFU window is involved. The board must be in UF2 mode (nrf52_enter_uf2). Refuses a file that is not a UF2 and an image built for the other SoftDevice than the one INFO_UF2.TXT reports. Requires confirm=True, or the user's answer when the client can ask. Runs as a flashes job whose job_id is in the result and logged before the wait; follow it with flash_poll if the call is canceled. A copy the bootloader did not take is a tool error.

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": {
      "uf2_path": "<uf2_path>"
    },
    "name": "nrf52_flash_uf2"
  }
}

Input Schema

NameRequiredDescriptionDefault
portNoThe board's app port, ideally its `/dev/serial/by-id` path; omit when only one UF2 drive is mounted.
confirmNo`True` once the user agreed; omitted, a client that can ask prompts the human.
uf2_pathYesThe .uf2 file to copy.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Well beyond the annotations, it discloses validation refusals, the SoftDevice-versus-INFO_UF2.TXT check, the confirm requirement, and the `flashes` job model with a job_id logged before the wait and recoverable via `flash_poll` if canceled. It even defines the failure contract ('a copy the bootloader did not take is a tool error'). Only minor gaps remain, such as the expected duration or the outcome when multiple UF2 drives are mounted without a port.

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?

Front-loaded with the action, then prerequisites, refusals, the confirm rule, and job-tracking guidance in tight order. Every sentence carries an operational fact; no filler or restatement of the name.

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 destructive, validation-heavy flash operation the description covers prerequisites, refusal conditions, consent, async tracking, and error semantics, and an output schema exists so return values need no explanation. An agent has everything needed to call it correctly or hand off to `flash_poll`.

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 100%, so the schema already documents `uf2_path`, `port`, and `confirm`. The description adds only marginal meaning, notably that `confirm` may be satisfied by the client prompting the human rather than an explicit True; that is useful but thin, so the baseline of 3 is right.

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, resource, and mechanism: 'Flash an nRF52 board by copying a .uf2 onto its bootloader UF2 drive.' It also distinguishes itself from the serial DFU path ('Several times faster than serial DFU'), which is enough to separate it from nrfutil_dfu-style siblings.

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?

Gives explicit preconditions and exclusions: the board must already be in UF2 mode via `nrf52_enter_uf2`, and the tool refuses non-UF2 files plus images built for a mismatched SoftDevice. It also states the confirm gate, so the agent knows exactly when invocation will proceed versus prompt the user.

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