Skip to main content
Glama

Inject Frame

inject_frame
Destructive

Injects forged LoRa packets into a connected Meshtastic board to exercise its real receive, decryption, and admin paths for testing; requires explicit confirmation.

Instructions

Inject a packet into a connected board as if it arrived off the LoRa radio.

Destructive: it forges over-the-air traffic, admin included. Requires confirm=True, or the user's answer when the client can ask. The target must run firmware built with -D MESHTASTIC_ENABLE_FRAME_INJECTION=1 (portduino sim nodes always accept it); the frame takes the real receive path, decryption and admin checks included. Wire format and an example: AGENTS.md, Frame injection.

Returns {ok, target, channel, channel_hash, injected, frames: [{from, to, id, portnum, bytes, ...}]}.

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": "inject_frame"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoThe destination node; defaults to the target.
pkiNoSend the `admin` frame as PKI-encrypted, for the PKC-admin path; needs `public_key_b64` and `encrypt=false`.
bodyNoThe message text, for `text`.
modeNo`text` (`body`), `raw` (`payload_hex` on `portnum`), `admin` (set_owner with `long_name`/`short_name`, optional `session_hex`; add `pki=true` and `public_key_b64` for the PKC-admin path), `ciphertext` (`ciphertext_hex` verbatim) or `fuzz` (`fuzz_count` malformed frames).text
portNoSerial port or `tcp://host[:port]`; omit to auto-select the one likely Meshtastic device.
confirmNo`True` once the user agreed; omitted, a client that can ask prompts the human.
encryptNoEncrypt with `channel_index`'s key (default true); pass false to inject decoded, which `pki` needs.
portnumNoThe port number the `raw` payload goes on.
from_nodeNoThe forged sender; 0 is dropped, as on air.0xdeadbeef
fuzz_seedNoThe RNG seed for `fuzz`, so a run repeats.
long_nameNoThe owner long name an `admin` frame sets.INJECTED
packet_idNoThe packet id to forge; omit for a random one.
fuzz_countNoHow many malformed frames `fuzz` sends.
short_nameNoThe owner short name an `admin` frame sets.INJ
payload_hexNoThe decoded payload as hex, for `raw`.
session_hexNoThe admin session passkey as hex, for `admin`; empty sends none.
channel_indexNoThe channel whose key `encrypt` uses.
want_responseNoSet the packet's want_response flag.
ciphertext_hexNoEncrypted bytes as hex, injected verbatim, for `ciphertext`.
public_key_b64NoThe sender's public key, base64, for `pki`.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, but the description adds substantive context: admin traffic is included, the frame traverses the real receive path with decryption and admin checks applied, and an explicit user-confirmation gate exists. It does not spell out persistent side effects (e.g. that admin mode sets owner names) or any rate/volume limits.

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?

Purpose is front-loaded, then safety/confirmation, then prerequisites, then the return shape; each paragraph does work. The return-value sentence is largely redundant given a full output schema exists, and the wire-format pointer to AGENTS.md is a deferral rather than content.

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?

For a 20-parameter, high-risk forge/inject tool the definition covers the safety gate, firmware prerequisite, real-code-path semantics and points to AGENTS.md for wire format, which is enough to call it correctly. It would be stronger if it stated the irreversible side effects of admin mode and how it differs from the replay_inject family.

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 100% across all 20 parameters, so the schema already carries the meaning of each mode and its dependent fields. The description adds little beyond that — the confirm interaction and the firmware gate are the only extras — so the baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Inject a packet into a connected board as if it arrived off the LoRa radio" gives a specific verb (inject), resource (packet/frame on a connected board) and scope (forged over-the-air traffic). It does not explicitly distinguish itself from the replay_inject* siblings, so an agent must infer that replay retransmits captured frames while this forges new ones.

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 states hard prerequisites (firmware built with -D MESHTASTIC_ENABLE_FRAME_INJECTION=1, portduino sims always accept) and the confirmation contract (confirm=True or the user's answer when the client can ask). The mode parameter descriptions add per-mode selection guidance. What's missing is any explicit routing to the replay_inject* alternatives or a when-not-to-use statement.

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