Skip to main content
Glama

hook_function

Record calls of any Unreal Engine function with its parameters, cap copied arguments to a set limit, and read the captured events via poll_events.

Instructions

Record every call of a UFunction, with its parameters. Counts as a write.

function is a UFunction path ('/Script/Engine.PlayerController:ClientRestart'). max_args caps how many parameters are copied per call (default 8). Read the calls with poll_events.

The callback copies parameters and the calling object's name and does nothing else. A native hook registers cleanly, but an eval that then CALLS the hooked function crashed the game with an access violation, so read hook output through poll_events and do not call a hooked function from eval_lua in the same session.

Hooking intercepts game code, so it is refused when allow_writes = false. Stop a hook with stop_stream, which unregisters it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
labelYes
functionYes
max_argsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.2.0

TDQS

A4.9/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full burden. It discloses that the callback copies parameters and the calling object's name and does nothing else, that calling a hooked function from eval_lua can crash the game with an access violation, and that it counts as a write requiring allow_writes. This is unusually candid and actionable.

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?

Although the description is substantial, every sentence earns its place: purpose, write semantics, parameter explanation, output retrieval, crash warning, permission gating, and stop mechanism. Safety-critical details are front-loaded and clearly separated.

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 high-risk hooking tool with no annotations and no output schema, the description covers invocation, parameter meaning, output retrieval via poll_events, unregistration via stop_stream, write-permission constraints, and a crash hazard. The only minor omission is the `label` parameter, but the tool is still safe and callable with this description.

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?

With 0% schema description coverage, the description must compensate. It explains `function` as a UFunction path with a concrete example and `max_args` as a per-call parameter cap with default 8. However, the required `label` parameter is never described, leaving a gap for a required input.

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 concrete action ('Record every call of a UFunction, with its parameters'), names the resource (a UFunction path), and explicitly notes that it counts as a write. This distinguishes it clearly from read-style siblings like poll_events and from call_function or eval_lua.

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?

Explicitly tells the agent to read hook output via poll_events, to stop a hook with stop_stream, and to avoid calling a hooked function from eval_lua in the same session. It also states that hooking is refused when allow_writes=false, giving concrete selection and safety guidance.

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