Skip to main content
Glama

emu_hook_call

Stubs a function at a specified address by skipping execution and returning a chosen value, preventing unknown-call stops when emulating libc or API calls.

Instructions

Stub a function at addr: skip it and return return_value.

Use for libc/API stubs such as malloc, strlen, printf. Prevents unknown-call stops. A float return_value is returned in the floating point return register. Returns confirmation.

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": {
      "addr": "<addr>",
      "return_value": "<return_value>"
    },
    "name": "emu_hook_call"
  }
}

Input Schema

NameRequiredDescriptionDefault
addrYes
nameNo
return_valueYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

No annotations exist, so the description carries the full burden: it discloses the skip-and-return semantics and the non-obvious detail that a float `return_value` goes in the floating point return register. It is silent on durability (does the hook persist across resets/runs?), whether a hook can be removed, what address space `addr` lives in, and what "Returns confirmation" actually contains.

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?

Three short sentences, front-loaded with the core effect before the usage example, with no filler. Slight fragmentation ("Prevents unknown-call stops." and "Returns confirmation." as standalone fragments) costs a little polish but nothing important.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Output schema exists, so return values need not be described, and the core behavior is covered. For a state-mutating emulator hook with zero annotation coverage, though, the definition should say whether the stub persists, how it interacts with emu_run/emu_reset, and what `name` does.

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 0% across 3 parameters, so the description must compensate and only partly does: it clarifies the meaning of `addr` and `return_value` (including the float/FP-register rule) in prose. The `name` parameter is never mentioned, and no type/format expectations are given for any parameter.

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?

"Stub a function at `addr`: skip it and return `return_value`" gives a specific verb, target, and precise effect, which immediately separates it from memory/run/load siblings like emu_read_mem or emu_run. The libc example clause reinforces exactly what kind of function gets stubbed.

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?

"Use for libc/API stubs such as malloc, strlen, printf. Prevents unknown-call stops" states a clear usage context and the problem it solves. It stops short of exclusions or an explicit alternative (e.g., when to patch memory instead of stubbing), so no fifth point.

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