Skip to main content
Glama

pio_size_report

Break down firmware flash and RAM usage by section, symbol, and source file to identify what to trim and shrink the build.

Instructions

Explain where flash and RAM go in the built firmware.elf: text/data/bss totals with percent of the board's flash and RAM, loaded sections classified as flash/ram, the biggest symbols (demangled, with file:line), and per-source-file totals. Use it to shrink firmware on purpose: drop the largest fonts/tables, remove unused features, tune build flags. Run pio_build first; filter is a regex applied to symbol names and file paths.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "pio_size_report"
  }
}

Input Schema

NameRequiredDescriptionDefault
envNo
topNo
filterNo
llm_modelNoThe model identifier you are running as, for example "claude-opus-4-8" or "gpt-5.2". Pass "unknown" if you are not certain. Recorded for the server developer's analytics.
project_dirNo
conversation_idNoThe conversation_id this server returned earlier in this conversation, unchanged, including after later user messages. Omit it if you have none. Recorded for the server developer's analytics.

Output Schema

NameRequiredDescriptionDefault
_mcp_instructionsNoServer-issued metadata for this conversation.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.9.0
    • removedInput schema / properties / context
      Removed value: -{
      -  "description": "A few words on why you are calling this tool, for the server developer's analytics. Describe people and things by role, such as \"a customer\". Do not quote the user or include names, emails, or other personal details.",
      -  "type": "string"
      -}
    • removedInput schema / required
      Removed value: -[
      -  "context"
      -]
  2. Changed5 schema fields changedv0.6.2
    • addedInput schema / properties / context
      Added value: +{
      +  "description": "A few words on why you are calling this tool, for the server developer's analytics. Describe people and things by role, such as \"a customer\". Do not quote the user or include names, emails, or other personal details.",
      +  "type": "string"
      +}
    • addedInput schema / properties / conversation_id
      Added value: +{
      +  "description": "The conversation_id this server returned earlier in this conversation, unchanged, including after later user messages. Omit it if you have none. Recorded for the server developer's analytics.",
      +  "type": "string"
      +}
    • addedInput schema / properties / llm_model
      Added value: +{
      +  "description": "The model identifier you are running as, for example \"claude-opus-4-8\" or \"gpt-5.2\". Pass \"unknown\" if you are not certain. Recorded for the server developer's analytics.",
      +  "type": "string"
      +}
    • addedInput schema / required
      Added value: +[
      +  "context"
      +]
    • addedOutput schema / properties
      Added value: +{
      +  "_mcp_instructions": {
      +    "description": "Server-issued metadata for this conversation.",
      +    "properties": {
      +      "conversation_id": {
      +        "description": "The server-issued conversation identifier.",
      +        "type": "string"
      +      }
      +    },
      +    "type": "object"
      +  }
      +}
  3. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the full burden, and it does substantial work: it discloses the report's exact contents, that it operates on an already-built firmware.elf, and that a prior build is required. It does not explicitly state that the operation is read-only and leaves unstated what happens if no build exists, which keeps it below a 5.

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?

Front-loaded with the core purpose, then usage rationale, then the prerequisite and filter semantics — a sensible ordering with no filler sentences. It is dense, packing several clauses into one paragraph, but each clause (percent of board flash/RAM, file:line, per-source-file totals) adds distinct information.

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?

Output schema exists, so return values needn't be explained, yet the description still previews the report shape helpfully. Prerequisite and filter behavior are covered; the main residual gap is the meaning of env and project_dir for a tool that must locate a build artifact, plus the absence of any failure-mode note when no build is present.

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 coverage is only 33%, so the description needs to compensate and it only partly does: 'filter' is well explained as a regex applied to symbol names and file paths (the schema gives it no description at all), and 'top' is weakly implied by 'the biggest symbols'. The env, project_dir, and analytics parameters receive no explanation, leaving roughly half the surface undocumented in both places.

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: it 'explains where flash and RAM go in the built firmware.elf', and enumerates exactly what the report contains (text/data/bss totals with percentages, section classification, biggest symbols with demangled names and file:line, per-source-file totals). This clearly separates it from pio_build (which produces the artifact) and from runtime tools like pio_memory_watch.

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?

Gives real usage context ('use it to shrink firmware on purpose: drop the largest fonts/tables, remove unused features, tune build flags') and an explicit prerequisite ('Run pio_build first'), which implicitly distinguishes it from the build tool. It stops short of naming when not to use it or pointing at sibling alternatives for memory questions.

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