Skip to main content
Glama

Lossless shrink

lossless

Shrinks TensorFlow Lite or ONNX models for edge chips with bit-identical outputs and no retraining, then unpacks TensorFlow Lite Micro and C sources into the project.

Instructions

Make the model smaller in SRAM and flash with outputs bit-identical to the original: no data, no retraining. Usually under a minute. Waits for the result, downloads it, and unpacks the model for TensorFlow Lite Micro and its C sources into the project. Returns the before -> after figures and the files. If it is still running after about four minutes it returns the run id: then call wait_for_run and download.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "model_path": "<model_path>",
      "chip": "<chip>"
    },
    "name": "lossless"
  }
}

Input Schema

NameRequiredDescriptionDefault
chipYesA chip name from list_chips.
folderNoWhere to unpack the result. Default: <the model's folder>/sensorforge/<run id>/.
overwriteNoReplace files already in the folder.
model_pathYesThe model: .tflite or .onnx, or a .zip of a firmware export.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

Annotations cover only the safety profile (not read-only, not destructive, not idempotent, open world); the description goes well beyond them. It discloses the correctness guarantee (bit-identical outputs), the blocking wait behavior, the roughly four-minute timeout with run-id fallback, and the side effect of downloading and unpacking files into the project.

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?

Front-loads the core outcome and its guarantee in the first sentence, then covers timing, side effects, return values, and the timeout fallback in tight succession. No filler and no repetition of schema content.

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 four-parameter, non-destructive compute tool with no output schema, the description covers what is produced (before -> after figures plus files), where files land, how long it blocks, and what to do on timeout. Nothing essential for correct invocation is missing.

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 chip, folder, overwrite and model_path are all documented in the schema itself. The description adds only indirect color about unpacking into the project, which loosely corresponds to the folder parameter, but gives no format or syntax detail beyond what the schema already provides.

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?

States a concrete action (shrink the model in SRAM and flash) with a defining property: outputs are bit-identical, requires no data and no retraining. That property implicitly separates it from an accuracy-trading sibling such as optimize, though no sibling is named explicitly, keeping it just short of a 5.

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 clear context (works without a dataset or retraining, runs usually under a minute) and an explicit escalation path: if still running after ~4 minutes it returns a run id, and the agent should call wait_for_run and download. It does not state when to prefer this over an alternative optimization tool, so no exclusion guidance is present.

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