Skip to main content
Glama

launch_game

Launches a game and injects a probe before initialization so hooks can intercept one-time setup logic; rejects duplicate processes and switches context when exe belongs to another game.

Instructions

启动游戏并在游戏初始化之前注入探针(能抢在初始化前挂钩)。

同名进程已在跑时直接拒绝(避免白等 60 秒再报「IL2CPP 未就绪」); exe 指向另一个游戏时会自动切换会话上下文(建新索引), 返回里给 context_switched 说明换了哪个。

比先手动开游戏再 inject_process 更强:能在对象被创建之前就装好 Hook, 适合拦截只执行一次的初始化逻辑。

会话上下文会自动跟随 exe:若它属于另一个游戏,会话身份与静态索引 会一起切过去(并建索引),返回里给 context_switched 说明。 否则 search_* 与 runtime_* 会分属两个游戏(实测过:index 140 个 image 对上运行时 143 个,image_count_matches=false,而工具全程 ok:true)。 反推不出 exe 所属游戏时不猜,用 context_warning 如实提示。

Args: exe: 游戏可执行文件路径。留空则用当前会话识别出的主程序。 args: 附加命令行参数。按 Windows 习惯拆:空白分隔,双引号内保留空白 (所以含空格的路径要写成 -path "C:\Games\My Game\a.txt")。 反斜杠不是转义符,Windows 路径可以直接写。

Input Schema

NameRequiredDescriptionDefault
exeNo
argsNo
preferred_moduleNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, openWorldHint=true, idempotentHint=false, destructiveHint=false, and the description adds real context beyond them: a refusal path for already-running processes, automatic session-context switching with an index rebuild, the context_switched return field, and a context_warning instead of guessing when the exe's game can't be inferred. It even explains the failure mode it prevents (index/runtime image mismatch with ok:true). It does not cover what happens to the previously active session or timing/return payload shape, keeping it below 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action and the key refusal rule, but the session-context-switching behavior is explained twice in near-identical paragraphs, and the parenthetical about 140 vs 143 images is over-detailed. The Args block is efficient, but the body could be roughly halved without losing information.

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?

For a launching/mutating tool with no output schema, the description covers prerequisites (session identity follows exe), failure modes (already-running process, uninferable game), and names the return fields the agent should inspect. The only real hole is the undocumented `preferred_module` parameter and what a successful launch returns beyond context_switched.

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?

Schema coverage is 0%, so the description carries the burden and largely succeeds: `exe` documents the empty-string default (use the session's identified main program) and `args` documents Windows-style splitting, quote handling for spaced paths, and that backslashes are not escapes. The third parameter, `preferred_module`, is never mentioned anywhere, leaving one of three parameters completely undocumented.

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 specific verb+resource (launch game + inject probe before initialization) and immediately differentiates from the sibling inject_process by explaining why launching first is stronger. The scope is unambiguous and an agent can pick it over inject_process without opening a schema.

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 names when to use it (intercepting one-shot initialization logic before objects exist), the alternative it beats (manually starting the game then inject_process), and a hard refusal condition (same-name process already running, which wastes 60s). That is when/when-not/alternative all in one place.

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