Skip to main content
Glama

cli_batch

Run multiple iNAV CLI commands in one batch session, reducing multiple reboots to a single one. Ideal for ad-hoc multi-command reads or writes.

Instructions

Run MANY CLI commands in ONE CLI session — a single reboot for the whole batch.

On iNAV, leaving the CLI ALWAYS reboots the FC, so every separate cli() call costs a full reboot + USB re-enumeration + reconnect (~7s). Doing a run of commands one cli() call at a time means one reboot PER command — the rapid reboot cadence is disruptive and can even knock the board into DFU/bootloader mode. This collapses N commands into ONE session = ONE reboot. Prefer it for any ad-hoc multi-command work (several get reads, or several set writes). (The dedicated write tools — apply_aircraft_setup, set_flight_mode, etc. — already batch internally; this is the escape hatch for everything else.)

Behaviour:

  • All read-only batch (get/diff/dump/status/tasks/version): the session exits WITHOUT saving — no EEPROM write, nothing persists. Still one reboot (unavoidable on iNAV), but reads are free of a save.

  • Any write (set/aux/feature/…): requires confirm_for_writes=True; a backup is taken first and the whole batch is SAVED once at the end (persist + reboot). If ANY command is rejected by the FC, the batch exits WITHOUT saving so nothing partial persists (all-or-nothing).

  • Live motor commands and session-control verbs (save/exit/batch) are rejected up front — motor tests must never be saved (use cli(..., props_removed=True) / test_motor()), and the batch manages save/exit itself.

Args: commands: Ordered list of CLI commands to run in one session. confirm_for_writes: Set True to run and persist a batch containing writes.

Returns per-command output, whether it saved, the backup path (if it wrote), and the measured reboot/reconnect seconds for the single reboot.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandsYes
confirm_for_writesNo
Behavior5/5

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

With no annotations provided, the description fully discloses critical behaviors: the cost of each CLI session (reboot + USB re-enumeration), the session exit semantics (no save for reads, save once for writes), the all-or-nothing policy on FC rejection, and rejection of motor commands. It also mentions the backup and return values, giving the agent a complete mental model of side effects and safety.

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 front-loaded with the core purpose in the first line, then uses clear section headers (Args, Behaviour) and bullet lists to organize dense information. Every sentence earns its place, explaining the why (reboot cost), the how (batch behavior), and the safety mechanisms without redundancy.

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?

Given the tool's complexity (batching, side effects, safety semantics) and lack of output schema, the description is remarkably complete. It covers the reboot implications, read vs write behavior, all-or-nothing persistence, motor command restrictions, and explicitly states what the return value contains, so the agent has all necessary context to invoke it correctly.

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

Parameters5/5

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

The input schema only lists types and defaults, but the description adds meaningful semantics: 'commands' is an 'Ordered list of CLI commands' and 'confirm_for_writes' must be set to run a batch containing writes. It explains why the confirmation is needed (write safety) and that a backup is taken, going far beyond the minimal schema definition.

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 'Run MANY CLI commands in ONE CLI session — a single reboot for the whole batch,' which is a specific verb+resource statement that clearly distinguishes this tool from the single-command 'cli' sibling. It also contrasts with dedicated write tools by positioning itself as the escape hatch for ad-hoc multi-command work.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit guidance: 'Prefer it for any ad-hoc multi-command work' and notes that dedicated write tools already batch internally, so this tool is only for other cases. It also tells users to use cli(..., props_removed=True) for motor tests, offering an alternative. This is clear when-to-use and when-not-to-use guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/starlordz12/inav-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server