Skip to main content
Glama

pio_power_profile

Measure a device's current draw over a set period to report average, min/max, p95, energy use, sleep/active time, and estimated battery life from serial meter data or a Nordic PPK2.

Instructions

Measure the device's current draw for seconds and report average/min/max/p95 mA, energy (mWh and µAh when voltage is known), a bucketed timeline, the share of time in sleep vs active (threshold auto-detected from the two dominant current levels, or sleep_threshold_ma), and a battery-life estimate. source='serial' reads a meter streaming readings on port (INA219/INA226 sketch, USB power meter log; pattern regex with (?P) and optional (?P)/(?P) groups, default: first number with uA/mA/A). source='ppk2' drives a Nordic Power Profiler Kit II (needs the power extra). Set trigger + trigger_session_id to start measuring when the firmware prints a line.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baudNo
portNo
sourceNoserial
bucketsNo
patternNo
secondsNo
triggerNo
voltage_mvNo
sleep_threshold_maNo
trigger_session_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full transparency burden and largely meets it: it discloses how readings are parsed (`pattern` regex with named groups), how the sleep threshold is auto-detected, and that triggering waits for a firmware line. It calls out the voltage dependency for energy reporting and the `power` extra requirement for ppk2. It does not cover side effects or permissions, but the core measurement behavior is well described.

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 dense but well-structured: main action and deliverables first, then source modes, then trigger setup. Backticked parameter names make mapping to the schema easy, and there are no wasted filler sentences.

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 10-parameter tool with zero schema descriptions and no annotations, this description is nearly complete: it explains outputs, data sources, regex format, prerequisites, and trigger semantics. Minor omissions like baud and explicit voltage_mv are mitigated by defaults and imputation, so an agent can invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, and the description compensates by giving real semantics to nearly every parameter: seconds, sleep_threshold_ma, source, port, pattern, trigger, and trigger_session_id are all explained, with voltage_mv and buckets implied. Only baud is left undocumented, and defaults soften that gap.

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 opening line uses a specific verb ('Measure') and identifies a precise resource ('the device's current draw'), then enumerates the exact outputs (average/min/max/p95 mA, energy, bucketed timeline, sleep/active share, battery-life estimate). This clearly distinguishes it from sibling monitor/upload/build tools.

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?

While it does not explicitly name when to prefer this over sibling tools, it gives clear internal routing between source='serial' and source='ppk2' and defines the trigger condition, which tells the agent exactly when those modes are appropriate. It also states a prerequisite (needs the `power` extra). No explicit 'do not use if...' exclusions, but the context is unambiguous.

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