Skip to main content
Glama

run_lua

Destructive

Run Lua code in Civ6: use gamecore context for read-only state queries, or ingame context for commands such as moving units and setting research.

Instructions

Run arbitrary Lua code in the game. Advanced escape hatch — prefer built-in tools.

Args:
    code: Lua code to execute. Use print() for output, end with print("---END---").
    context: "gamecore" (default) for read-only state queries.
             "ingame" for commands and UI-dependent queries.

Context differences:
  gamecore: Players[], GameInfo.*, Map.*, Game.* — safe read-only access.
            CANNOT use: UI.*, UnitManager.*, CityManager.*, notifications.
  ingame:   All APIs including UI.*, UnitManager.*, CityManager.*.
            Use for: moving units, setting research, diplomacy actions.

Always use print() for output (not return).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
contextNogamecore

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Description expands beyond destructiveHint annotation by detailing safety profiles (gamecore read-only, ingame mutable), output via print() convention, and limitations of each context. No contradictions.

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?

Well-structured with clear sections (Args, Context differences, Always use). Concise yet comprehensive; every sentence adds value.

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?

Comprehensive for an arbitrary code execution tool: purpose, usage, parameters, constraints, output conventions, and safety considerations. Output schema exists but description still provides necessary context.

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

Parameters5/5

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

Schema has 0% coverage but description explains both parameters: code (with print() usage) and context (with allowed values and behavioral differences). Fully compensates for missing schema descriptions.

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?

Clear purpose: 'Run arbitrary Lua code in the game. Advanced escape hatch — prefer built-in tools.' Distinguishes from siblings by noting it's an escape hatch.

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?

Explicit when to use ('prefer built-in tools'), context differences (gamecore vs ingame) with detailed allowed APIs and use cases. Provides clear guidance on selecting context based on safety needs.

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

Install Server

Other Tools

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/wrislin1/civ6-mcp'

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