Skip to main content
Glama

hot_reload

Apply changed code to a running program without restarting it, preserving state while updating Flutter builds or redefining Java classes.

Instructions

Apply changed code to the running program and keep its state — the adapter's own live update. Flutter: the SDK adapter's hot reload (the app must have started; the reassemble runs build(), so a breakpoint there is reported by this call as the stop, with its location and snapshot; widget state, counters and timers survive; a reload sent to a paused program lands when it resumes). Java: class redefinition (JDI HotSwap) — scans classesDir for .class files modified after sinceTimestamp, redefines the ones the JVM has loaded, re-plants breakpoints, and returns which classes were redefined and the newest file timestamp (pass it as sinceTimestamp next time for an incremental update). Statement-anchored breakpoints are re-resolved against the new source after the update (anchorResolution reports moved/stale). Refused by name on the other languages. redefine_classes is a deprecated alias of this tool.

Input Schema

NameRequiredDescriptionDefault
timeoutNoMax time (ms) to wait for the update to complete (default: 30000, max: 600000). Increase when hot-swapping many classes at once
sessionIdYes
classesDirNoJava only: absolute path to the compiled classes directory (e.g. build/classes/java/main/)
sinceTimestampNoJava only: Unix timestamp (ms). Only redefine .class files modified after this time. 0 or omitted = all files.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.26.0

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does most of it: state survives, breakpoints are re-planted and re-resolved, a reload to a paused program lands on resume, and a breakpoint in build() surfaces as the stop with location and snapshot. It does not address permissions/authorization or whether a failed partial swap can leave the program inconsistent, so it stops short of a 5.

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?

Front-loaded with the core purpose and state-preservation claim, then split cleanly by language. It is dense and long, but nearly every clause conveys behavior an agent needs given two distinct implementations; only the parenthetical about breakpoints in build() is slightly overloaded.

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?

There is no output schema, and the description compensates by stating what is returned: which classes were redefined, the newest file timestamp, and anchorResolution reporting moved/stale breakpoints. Combined with the per-language prerequisites and refusal behavior, an agent has enough to call this correctly.

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 75%, with timeout, classesDir, and sinceTimestamp already documented, so baseline is 3. The description adds real value beyond the schema by explaining the classesDir scanning semantics (files modified after sinceTimestamp) and the incremental pattern of feeding back the returned newest timestamp, though sessionId remains undocumented in both places.

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 effect ('apply changed code to the running program and keep its state') and then specializes it per language: Flutter SDK hot reload and Java JDI HotSwap class redefinition. No sibling tool does this, and the description makes that unambiguous, including naming the deprecated alias redefine_classes.

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 about when it applies (Flutter and Java), when it is refused ('refused by name on the other languages'), and prerequisites ('the app must have started'). It also gives operational guidance like increasing timeout for many classes and passing the returned timestamp as sinceTimestamp for incremental updates.

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