Skip to main content
Glama

eval_lua

Run Lua code inside a UE4SS game on the game thread and get the return value, print output, and access full game scripting API for inspection and modification.

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). 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. Dates show when Glama detected each change.

  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 provided, the description carries the transparency burden. It does disclose that execution runs on the game thread, returns the result, captures print output, and can be refused based on settings. It does not mention potential side effects, error behavior, or timeout consequences, which are important for an arbitrary code execution tool.

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 reasonably concise and front-loaded with the primary purpose. It includes useful additional details about API availability and refusal conditions without excessive verbosity, though it could be slightly more compact.

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?

The tool is complex due to arbitrary Lua execution, and there is no output schema. The description provides some context such as the available API, UEB helper table, print capture, and refusal condition, but it omits return serialization details, timeout behavior, and error handling, leaving gaps for an agent that needs to invoke it safely.

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 description coverage is 0%, so the description must compensate. It implicitly clarifies that 'code' is a Lua chunk, but it does not explain the 'timeout' parameter despite its default value, leaving its semantics and behavior unclear. The description adds only partial meaning beyond the bare parameter names.

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 a specific action: 'Run a Lua chunk inside the game on the game thread and return what it returns.' It distinguishes this tool from siblings by emphasizing arbitrary Lua execution and capturing print output, which separates it from call_function, console_command, and other focused tools.

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 usage for arbitrary Lua scripting when the full UE4SS API or UEB helper table is needed, and it notes the refusal condition when allow_eval is false. However, it does not explicitly compare against sibling tools like call_function or console_command, so when-to-use guidance is only implied rather than direct.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/littleRabbit94/ue-bridge'

If you have feedback or need assistance with the MCP directory API, please join our Discord server