Skip to main content
Glama
ryuto-alt

DX12 Engine MCP Server

by ryuto-alt

Lua即時実行

dx12_eval_lua

Evaluate Lua code in the engine's Lua environment to debug and modify scene entities, physics forces, and audio during editing or playback. Returns the string representation of the code's return value.

Instructions

任意の Lua コードをエンジンの Lua state でその場実行する(強力なデバッグ機能)。globals フォールバック環境なので scene/physics/camera/audio/events 等の既存グローバルバインディング(dx12_describe_lua_api 参照)がそのまま使える。例: local e = scene:findEntity("Player"); e.transform.position.y = e.transform.position.y + 1; return e.transform.position.y。code が値を return していれば result にその tostring() 文字列が入る(無ければ空文字)。★print() は捕捉されない — デバッグ出力は log(msg) を使うと dx12_get_log に出る。副作用のある操作(位置変更・物理力印加等)は Editor/Playing 両方で実行できるが、bodies は Play 中のみ登録されているため物理系は Playing 中でないと効果が無い。localhost 限定・認証なしという既存のセキュリティモデルと同水準。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes実行する Lua コード(複数行可)。

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultNoエンジンからの生の結果。実際の形は各ツールの説明 / dx12_describe_components を参照。text にも同内容を JSON 文字列で格納。
Behavior5/5

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

Disclosures go far beyond annotations: notes that print() is not captured (use log(msg)), explains globals fallback, side effects, bodies condition, and return value behavior. No contradiction with annotations.

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?

Despite length, every sentence adds necessary information. Front-loaded with purpose, then provides usage details, example, and edge cases. No wasted words.

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?

Given one parameter, full schema coverage, and rich annotations, the description covers all needed aspects: behavior, side effects, return values, and constraints like security and physics bodies.

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?

The single parameter 'code' is described in schema as 'executable Lua code'. The description adds significant value: explains that globals are available, gives an example, explains return value handling. Schema coverage is 100%, but description enriches meaning.

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 it executes arbitrary Lua code in the engine's Lua state for powerful debugging. It distinguishes itself from sibling tools like dx12_describe_lua_api or dx12_read_lua_component by focusing on immediate execution.

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?

Provides detailed context on when to use: as a debug function. Mentions that side effects work in both Editor and Playing modes, but physics bodies only during Play. Also notes security model (localhost, no auth). Lacks explicit when-not-to-use or alternatives, but still strong.

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/ryuto-alt/dx12-mcp'

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