Skip to main content
Glama

scene_add_global_timer

Destructive

Define a global countdown or stopwatch timer for a player or stage in a Miliastra level, so graphs can start it, react when it ends, and show round or day length without counting ticks.

Instructions

Define a global timer (全局计时器) in a copy of a save and give it to the player template (holder "player", one per player) or to the stage entity (holder "stage", one for the level): a countdown of some seconds, or a stopwatch with countdown false. A graph starts it with f.startGlobalTimer(holder entity, name); when a countdown ends, a graph on the holder hears whenGlobalTimerIsTriggered. Use it for the length of a round or of a day, instead of counting ticks in a graph: it can also be shown on the screen with scene_add_timer_display. Writes a new .gil in the workspace; the official save is not touched. Verified in play on 2026-10-10: a timer held by the stage starts counting by itself when the level loads (several seconds before the graphs start), whenGlobalTimerIsTriggered fires when it reaches zero, and f.startGlobalTimer starts it again after that.

Input Schema

NameRequiredDescriptionDefault
nameYes
holderNoplayer
mapPathNo
secondsYes
countdownNo
outputNameNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare write/destructive/openWorld flags; the description adds the crucial scope qualifier that the official save is untouched and only a new .gil is written. It also discloses runtime lifecycle behavior — a stage-held timer counts down on level load before graphs start, fires whenGlobalTimerIsTriggered at zero, and can be restarted via f.startGlobalTimer — which an agent could not infer from any structured field.

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 holder distinction are front-loaded, and each clause carries information. It is dense and the trailing verification sentence, while genuinely useful, is long enough to dilute the core instruction.

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 write tool with annotations, 6 params and no output schema, it covers safety scope, runtime behavior, and the companion display tool. Remaining gap: two parameters (mapPath, outputName) are undocumented anywhere, so an agent must guess what outputName controls in a workspace that already writes a new .gil.

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?

With 0% schema description coverage across 6 params, the description carries the load: it explains holder values ('player' vs 'stage'), what countdown=false means (stopwatch), and how name is referenced by f.startGlobalTimer. It leaves mapPath and outputName entirely unexplained, and seconds is only loosely defined ('a countdown of some seconds') despite a 86400 maximum in the schema.

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 and resource (define a global timer in a copy of a save) and immediately distinguishes the two holder variants: player template (one per player) vs stage entity (one for the level). An agent can tell this apart from scene_list_global_timers and scene_add_timer_display without opening any 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?

Gives an explicit use case ('the length of a round or of a day'), an explicit alternative to avoid ('instead of counting ticks in a graph'), and names the follow-on tool (scene_add_timer_display) plus the graph calls (f.startGlobalTimer, whenGlobalTimerIsTriggered) that consume the timer. Routing is fully specified.

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

Deploy Server

Other Tools