Skip to main content
Glama

build_firmware

Destructive

Rebuild STM32 firmware via Keil, CMake, make, or a custom command, returning exit status, success flag, and build log tail so AI agents can verify fixes.

Instructions

Builds firmware with Keil uVision (UV4), CMake, make, or a custom command, so the AI can rebuild after a fix. Keil emits a .axf (ELF/DWARF) that the debug tools load like any .elf. Returns the exit code, success flag, and build log tail.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoWorking directory for the build.
kindYesToolchain to build with.
configNocmake: build config, e.g. Debug/Release.
targetNoKeil/CMake/make build target.
commandNocustom: full argv to run.
projectNokeil: path to the .uvprojx/.uvproj project.
rebuildNokeil: rebuild all (-r) instead of incremental (-b).
sessionNoOptional debug-session name. Omit for the default target.
uv4_pathNokeil: path to UV4.exe (auto-detected if omitted).
build_dirNocmake: the configured build directory.
directoryNomake: directory containing the Makefile.
timeout_secNoMax build seconds (default 600).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.15.1

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, non-idempotent, open-world, so the safety profile is covered. The description adds useful artifact context (Keil emits .axf usable by debug tools) and states the return payload (exit code, success flag, log tail), but never explains what the destructive hint means (overwritten build outputs) or permission needs.

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?

Three front-loaded sentences, purpose first, with no filler. The .axf/debug-tools sentence is slightly tangential but earns its place by linking the build artifact to downstream tools.

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?

With 12 parameters and no output schema, the description does the needed work by naming the toolchains and describing the return values. Only the meaning of the destructive annotation and any required setup are left unaddressed.

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 every parameter including the kind enum is already documented. The description adds only that Keil produces .axf and names the toolchains; it does not add syntax or defaults beyond the schema, so the baseline 3 applies.

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 (builds) and resource (firmware) plus the four supported toolchains, and it is clearly distinct from sibling flash_firmware (build vs deploy). An agent can tell exactly what this does without opening the schema.

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?

"so the AI can rebuild after a fix" gives an implied usage scenario, but there is no explicit when-not guidance or named alternative (e.g., build_firmware vs flash_firmware sequencing). Usage is inferable rather than spelled out.

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