Skip to main content
Glama

eval_lua

Run Lua code inside a UE4SS game on the game thread, returning results and printed output. Enables full Lua API inspection and automation.

Instructions

Run a Lua chunk inside the game on the game thread and return what it returns.

The full UE4SS Lua API is available (StaticFindObject, FindFirstOf, FindAllOf, RegisterHook, ForEachUObject, ...) plus the UEB helper table: UEB.resolve(ref), UEB.props(ref), UEB.funcs(ref), UEB.get(ref, name), UEB.set(ref, name, value), UEB.call(ref, fn, args), UEB.objects(class, limit), UEB.types(pattern, limit), UEB.console(cmd), UEB.world(), UEB.dump(kind), UEB.snapshot(ref, label), UEB.diff(ref, label), UEB.snapshots(), UEB.forget(label), UEB.subclasses(ref, limit, pattern), UEB.target(distance, channel, ref), UEB.watch(ref, names, label, interval_ms, every), UEB.hook(fnpath, label, max_args), UEB.events(since, label, limit, clear), UEB.streams(), UEB.unwatch(label). UEHelpers is in scope too. print() output is captured and returned alongside the result. Refused when the mod's settings.lua sets allow_eval = false; the other tools keep working.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
timeoutNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior4/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 execution happens on the game thread, captures print() output, and is refused when allow_eval=false. It does not cover error handling or side effects, but the refusal condition is a valuable behavioral note.

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?

The description is long due to the detailed API listing, which is useful for an eval tool but could be trimmed. The main purpose is front-loaded, and the structure is clear, though the API enumeration may be oververbose.

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?

With no output schema, the description explains the return value (Lua result and print output) and the available Lua environment. It lacks error-handling details but is otherwise sufficiently complete for an agent to understand the tool's capabilities and constraints.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must explain parameters. It implicitly covers 'code' but does not describe the timeout parameter or its purpose. The extensive API list adds context but not parameter-specific semantics.

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?

The description clearly states the tool's purpose: 'Run a Lua chunk inside the game on the game thread and return what it returns.' This is a specific verb and resource, and it distinguishes from sibling tools like call_function or console_command by emphasizing arbitrary Lua execution.

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?

The description implies this is the general-purpose Lua execution tool but does not explicitly state when to prefer it over alternatives. It mentions the refusal condition (allow_eval=false) and that other tools keep working, but lacks direct comparison to siblings.

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