Skip to main content
Glama
ZMC1011

Keil5 MCP Server

by ZMC1011

flash_firmware

Program firmware onto target STM32 chips via Keil UV4 or pyOCD, with automatic backend selection and explicit confirmation required for safe operation.

Instructions

Flash firmware to the target chip.

Preferred path: UV4 -f (Keil official flash download, uses the project's configured Flash algorithm). Fallback: pyocd load . Requires confirm=True (persistent destructive operation).

Args: project: .uvprojx path (for UV4 -f) — required unless image is given target: target name for UV4 -f image: firmware image (axf/hex/bin) for the pyocd path backend: "uv4" | "pyocd" | "auto" probe_id: pyOCD probe unique id (optional) confirm: MUST be True to actually flash

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
imageNo
targetNo
backendNoauto
confirmNo
projectYes
probe_idNo
timeout_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations provided, the description carries full behavioral disclosure. It explicitly warns that flashing is a 'persistent destructive operation' and that confirm must be True for the operation to actually occur. This is critical safety information beyond what the schema conveys.

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?

The description is compact, front-loaded with the core purpose, and uses a clearly labeled Args section. Every sentence earns its place, and the confirm warning is appropriately emphasized.

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

Completeness3/5

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

The tool is complex with 7 parameters, multiple backends, no annotations, and no output schema. The description covers many important aspects but leaves backend auto selection unspecified, does not explain timeout_seconds, and contains the project-required contradiction. An agent would still need to resolve ambiguities before reliably invoking it.

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?

The description adds meaningful semantics to most parameters, including project path, target, image formats, backend options, probe_id, and confirm. However, it omits timeout_seconds entirely and, more seriously, claims project is 'required unless image is given,' which contradicts the input schema where project is unconditionally required. This could mislead an agent into an invalid invocation.

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 description clearly states a specific verb and resource: 'Flash firmware to the target chip.' It distinguishes the tool from siblings like build_project, erase_flash, and verify_flash by focusing on the actual flashing operation. The additional detail about UV4 and pyocd paths reinforces a concrete, unambiguous purpose.

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?

The description gives clear context for how to flash: a preferred UV4 path and a pyocd fallback, along with the confirm=True requirement. It does not explicitly mention when to prefer this tool over sibling tools such as erase_flash or verify_flash, but its purpose is self-evident and the internal path guidance is strong.

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