Skip to main content
Glama

gc_control

Pause or resume the game's garbage collection during hooking to prevent observed objects from being reclaimed, then restore it after inspection to avoid memory growth.

Instructions

暂停/恢复游戏的 GC(垃圾回收)。

Hook 期间建议暂停 GC,避免正在观察的对象被回收掉。 观察结束后务必恢复(disable=False),否则游戏内存会持续增长。

标注上 idempotentHint=False:它是状态开关,disable=True 与 disable=False 是两个不同状态,且「开了没关」会让内存持续增长。 同参数重复调确实无额外影响,但把这个调用标成「幂等」会被客户端读成 「可以随便重试」—— 在一个已经暂停了 GC 的会话里那样做是错的。 探针卸载时会自动恢复 GC(见 agent.js 的 dispose),但那是兜底, 不该替代调用方自己恢复。

Args: disable: True 暂停 GC,False 恢复。

Input Schema

NameRequiredDescriptionDefault
disableNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations it explains the consequence of misuse (unbounded memory growth) and pre-empts the idempotency misreading — why idempotentHint=false must not be read by a client as 'free to retry'. It also discloses the automatic restore in agent.js dispose, which is exactly the kind of context annotations cannot carry.

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?

Purpose and the critical warning are front-loaded, and the Args block anchors the parameter. The middle section defending the idempotentHint choice is somewhat meta and longer than an invoking agent strictly needs, though it does prevent a real misuse.

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?

For a one-parameter stateful mutation with no output schema, everything needed is present: what changes, the risk of leaving it on, restoration obligation, and the fallback cleanup path. Sibling tooling handles the surrounding hook workflow, so nothing essential is missing.

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 must carry the single parameter, and it does: 'disable: True pauses GC, False resumes'. It does not flag that the schema default is true, which makes a bare call silently pause GC — a meaningful omission for a stateful toggle, but the core semantics are covered.

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 first line states a concrete verb and resource: pause/resume the game's garbage collector. It is unmistakably distinct from siblings like hook_method, unhook, and read_memory, and the toggle nature is spelled out immediately.

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?

It gives explicit when-to-use (pause during hooking so observed objects aren't collected), when-to-restore (always resume after observation ends, otherwise memory grows), and even documents the safety-net behavior on probe unload that should not replace caller-side restoration. Both the positive and negative conditions are covered.

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