Skip to main content
Glama

get_build_info

Retrieve detailed information about one firmware build, including identity, health, memory map, and defines. Select a project and variant or image to inspect a specific build.

Instructions

Return the detail of ONE build: its identity, its health, its memory map and its defines.

Read-only with the two exceptions that get_project_status also has: it removes the marker of a missing build when it finds that build again, and a reindex.pid or a reindex.pending of a process that no longer runs. It spawns no subprocess. On a project of more than one build, give the arguments of one build as the refusal lists them: the variant, the image, or the two. get_project_status lists the builds in builds. Without the arguments the answer is an error that lists the builds. A project of one build needs no selector.

The health fields (status, reindex_state, reindex_needed, reindex_reasons, index_message, modified_files_count and the others) have the meaning that get_project_status gives them, for this build only. The version fields (update_notice, a restart after an upgrade) are in get_project_status.

About memory: origin and length hold the expression the script writes, thus they differ by platform — an mbed script writes 0xefe00 and a Zephyr script writes ((673792) - 0xe6). origin_value and length_value hold the number, and both are None for an expression that names a symbol, such as ORIGIN(RAM) + LENGTH(RAM). A name that the link command defines with --defsym counts as a number: the STM32 Arduino core writes LENGTH = LD_MAX_DATA_SIZE and gets length_value 98304. The end of a region is origin_value + length_value.

memory is empty for a build system that records no linker script, such as Keil or IAR. A PlatformIO project records its link only in fw-context index --build: SCons writes no file with the link command, thus the build asks pio run -t envdump. An empty list for PlatformIO means that no build recorded the link yet, and fw-context index --build is the step. An empty list means "not recorded", never "no memory".

defines holds only the names that EVERY translation unit of the build carries with the same value, so the tool never shows the defines of one file as the defines of the build. defines_varying counts the names left out, thus a name absent from defines is either not defined at all or not defined everywhere. Measured on the Mbed project, 27 names are in all 881 units and 59 in only some, where the three assembly files get a shorter set.

This is the configuration the BUILD states, not every macro the preprocessor saw. The second is three orders of magnitude larger — 27800 distinct names on the STM32 project — and almost all of it comes from the headers and the compiler. A Zephyr build keeps its real configuration in autoconf.h (740 CONFIG_* names) and passes few -D flags, so defines says little there and a great deal on an mbed build, where it holds APPLICATION_ADDR, APPLICATION_SIZE, and CMSIS_VECTAB_VIRTUAL.

Args: project_root: Project root directory. Auto-detected from CWD if omitted. project: Project name or project_id — call list_projects to get them. Use it to ask about a project that is not the project of the current directory. It is an alternative to project_root, which takes a root path. Give one of the two, not both. variant: Variant of the build (a board, or a PlatformIO environment). On a project of more than one build, give the arguments of one build as the refusal lists them: the variant, the image, or the two. fw-context does not select a build. One query answers for ONE build. image: Image of the build: a separate program, such as the application or the bootloader. Give it when the build has an image name. fast: When True (default), the header check reuses the cached manifest hashes. False recomputes them.

Returns: dict: {variant, image, board, config_hash, project_id, project_root, build_system, compile_commands, indexed_at (str — UTC), first_indexed_at, symbol_count, file_count, reference_count, modified_files_count, header_affected_tus, manifest_verification, analysis, description, vendor_paths, project_paths, effective_vendor_patterns (list[str] — the SQL LIKE patterns that this build really used to mark vendor code, for example ["mbed-os/%"]; empty when the manifest cannot be read. The two lists above hold what the config asks for, this one what the index did), status, reindex_state (str or None — see get_project_status), reindex_needed, reindex_reasons, stale, index_message, entry_point (str — the ENTRY() of the linker script of the build, empty when no script names one), memory (list[dict] — the MEMORY regions of the build: {name, attributes, origin, length, origin_value, length_value, file_path, line}), defines (dict — the -D flags of the build), defines_varying (int), bg_reindex_running (bool), reindex_progress (str or None), vec_available (bool), vec_error (str, optional), _warning (str, optional), client_restart_required (bool, optional), client_restart_reason (str, optional)}

A refusal of the selector, or an index with no build config, gives
a dict that holds ``error`` alone.  A project that is not
initialized, that has no index, or whose config file cannot be used
(``"config_error"``) gets the answer of ``get_project_status``.
``config_warnings`` (a list) comes as in ``get_project_status``.

Input Schema

NameRequiredDescriptionDefault
fastNoWhen True (default), reuse the cached manifest hashes for the header check. Pass False to recompute them, which is far slower.
imageNoImage of the build: a separate program, such as the application or the bootloader. On a project of more than one build, give it when that build has an image name, as the refusal lists it.
projectNoProject name or project_id — call list_projects to get them. Use it to ask about a project that is not the project of the current directory. It is an alternative to project_root, which takes a root path. Give one of the two, not both.
variantNoVariant of the build (a board, or a PlatformIO environment). On a project of more than one build, give the arguments of one build as the refusal lists them: the variant, the image, or the two. fw-context does not select a build for you. One query answers for ONE build.
project_rootNoProject root directory. Auto-detected from CWD if omitted. This field also accepts a project name or a project_id, but project is the clear field for those.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.32.1

TDQS

A4.2/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 burden and does so thoroughly: it states the read-only exceptions, that no subprocess is spawned, how missing-build markers are cleaned up, and what an empty `memory` list means. It also explains cached manifest behavior for `fast=False` and error/refusal responses.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded and the Args/Returns sections are structured, but the description is heavily overlong for an invocation reference. Worked examples about Mbed, Zephyr, STM32, `--defsym`, and unit counts consume substantial space without improving tool selection or invocation.

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 complex build-inspection tool with no output schema and no annotations, the description is complete: it documents return fields, selector errors, side effects, and edge-case meanings for `memory` and `defines`. An agent has enough context to call it correctly and interpret the result.

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 all five parameters. The description repeats selector behavior and argument usage, but adds little parameter meaning beyond what the schema provides.

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 opens with a specific verb and resource: 'Return the detail of ONE build: its identity, its health, its memory map and its defines.' It clearly distinguishes this build-level detail from `get_project_status`, which lists builds and carries project-level version fields.

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?

It gives concrete selector guidance for multi-build projects and notes that `get_project_status` lists the builds, while a one-build project needs no selector. It also points version fields to `get_project_status`, but it does not explicitly frame a concise use-this-vs-that rule beyond the build-level scope.

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