Skip to main content
Glama
retrace-mcp

retrace-mcp

by anthoo582

mips_reconstruct_function

Reconstruct a MIPS function’s structure from machine code, including CFG edges, stack frame, saved registers, parameters, loops, and heuristic pseudo-C; does not claim original source.

Instructions

Reconstruct a function's structure from MIPS instructions: CFG edges, stack frame, saved registers, parameters, loops and heuristic pseudo-C. Never claims to be original source.

Input Schema

NameRequiredDescriptionDefault
abiNoCalling convention used for argument/return registers
hexYesHex string of function machine code
archNo
nameNoLabel for the function
addressNoBase virtual address

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations at all, the description carries the full burden. It does add genuinely useful behavioral context by framing the output as 'heuristic pseudo-C' and explicitly disclaiming fidelity ('Never claims to be original source'), which sets the right expectation for the reconstruction. It says nothing about determinism, performance limits on input size, failure behavior for malformed hex, or whether arch/abi mismatches produce wrong-but-plausible results.

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?

Two sentences, front-loaded with the core action and the returned artifacts, followed by a short honesty caveat that earns its place by preventing downstream misuse of the output. There is no padding, though the artifact list is delivered as a comma run rather than a structured enumeration.

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 no-annotation, no-output-schema tool with five parameters, the description is nearly sufficient: it describes the shape of the result the agent can expect, which substitutes for the missing output schema. The remaining gap is operational — no hints on error conditions or on how the arch/abi enums constrain interpretation of the hex input.

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 80% and the schema already documents hex, abi, name, and address, so the baseline of 3 applies. The description adds no parameter-level meaning whatsoever — notably it does not explain how the optional 'arch' and 'abi' choices interact with the required 'hex' input, which is the main ambiguity an agent faces here.

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?

The description states a specific verb and resource ('Reconstruct a function's structure from MIPS instructions') and enumerates the concrete artifacts produced: CFG edges, stack frame, saved registers, parameters, loops, and pseudo-C. It does not name or differentiate itself from nearby siblings such as mips_disassemble or mips_analyze_function, so an agent must infer whether this supersedes or complements them.

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

Usage Guidelines3/5

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

Usage is only implied: the tool clearly follows on from disassembly, but there is no explicit statement of when to choose it over mips_analyze_function or decompile_function, and no prerequisites are given (e.g., that hex must be raw function machine code rather than a whole ROM). Guidance is adequate but leaves routing decisions to inference.

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