Skip to main content
Glama

Carve bytes out of a file

re_extract

Copy an embedded byte range from a source file into a separate workspace file to extract assets such as PNG, WAV, GLB, or ZIP data; length can be omitted for self-describing formats.

Instructions

Copies a byte range (e.g. an embedded PNG/WAV/glb/ZIP found by re_probe) into the workspace as its own file. length is optional when the embedded format stores its size (RIFF/WAV, glb, PNG). To unpack a whole archive or pack, use re_archive with action:"extract" instead.

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": {
      "file": "<file>",
      "offset": "<offset>"
    },
    "name": "re_extract"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesSource file.
nameNoOutput file name.
lengthNoBytes to copy.
offsetYesStart offset.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.25.0

TDQS

A4.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, and idempotentHint=false, so the write/non-destructive profile is known. The description adds that output lands in the workspace as a new file, but is silent on overwrite behavior on name collision and on the default output name when `name` is omitted — both material for a write tool with an optional naming parameter.

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?

Two sentences, zero filler, with the core action front-loaded and the sibling redirect placed last where it belongs. Every clause carries information an agent needs.

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 four-parameter extraction tool with no output schema, the definition covers the action, the format-dependent length rule, and the alternative tool. The only shortfall is the unaddressed output naming/overwrite semantics, which an agent would otherwise have to discover by trial.

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 100%, so the baseline is 3; the description earns an extra point by explaining that `length` is optional for self-describing formats (RIFF/WAV, glb, PNG), which is behavioral meaning the schema's 'Bytes to copy' does not convey. It says nothing extra about `name` or `offset` beyond what the schema already documents.

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 and resource: 'Copies a byte range ... into the workspace as its own file.' It also names the discovery sibling (re_probe) that produces the offsets, so the agent knows how this tool fits into the workflow without opening the schema.

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?

Gives an explicit exclusion with the alternative named: 'To unpack a whole archive or pack, use re_archive with action:"extract" instead.' It also states the condition under which length can be omitted, which is the main invocation decision an agent faces here.

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