Skip to main content
Glama
roman-zaglauer

OctoBot MCP Server

wait_for_octobot_ready

Wait for OctoBot's HTTP server to become reachable again after a restart, returning ready only after a confirmed outage and recovery.

Instructions

Poll for OctoBot's HTTP server becoming reachable again after a restart.

A bounded retry loop against GET /api/version (see this module's docstring for why this specific route was chosen) -- never blocks past timeout_seconds, and never raises for a timeout: that is a normal, honestly-reported result (NFR-3's "honest null/false over a fabricated guess" ethic), matching every other timeout-bounded loop in this project.

Correctness fix (resolving part of open question #14, live-verified against the test instance): a ready: true result now REQUIRES having observed at least one genuinely unreachable poll first. An earlier version of this tool returned ready: true after its very first poll succeeded -- but restart_octobot's own route schedules OctoBot's kill with a confirmed ~2-second delay (models.restart_bot(delay=2), ADR-0010's Context), so a poll issued immediately after restart_octobot returns will almost always land WITHIN that grace window and hit the OLD, not-yet-killed process -- a false positive that completely defeats this tool's purpose. Confirmed live, twice, against the OctoBot 2.1.1 test instance: the HTTP server stayed reachable until ~2.1s post-trigger (matching the confirmed 2s delay almost exactly), then was genuinely unreachable for ~6.3-6.7s, before answering again at ~8.5-8.9s total. A naive first-success-wins loop reported ready: true in ~0.05s both times -- entirely within the pre-kill grace window, never having observed the real restart at all. This loop now tracks whether it has seen a failed poll; a success only counts as ready: true once at least one prior poll in this same call has failed, so ready: true now means "the server went down and came back," not just "answered."

"Ready" (even with the fix above) still means ONLY "the HTTP server answered a request again after a confirmed outage" -- nothing more, and this is now a CONFIRMED gap, not a suspected one. A follow-up live test checked SimpleStrategyEvaluator's default_config/ required_evaluators immediately after a genuine, confirmed restart (dense-polled, not a race) -- unchanged from before the restart. The same end result (restart does not unblock strategy-composition-tuning validation via backtest) was independently confirmed on an entirely separate OctoBot instance/session. Do not present restart_octobot/ wait_for_octobot_ready as a fix for evaluator/strategy-composition tuning validation -- that was this capability's whole stated purpose (ADR-0010's Context) and it does not hold. See ADR-0010's "Negative finding" (Context) and Consequences for the full account, including an open question of whether this capability should be kept at all given its purpose doesn't hold. Order-execution parameters (sizing, stop-loss/take-profit) are unaffected by any of this and apply correctly in a profile_id-targeted backtest without a restart.

DEFAULT_TIMEOUT_SECONDS/DEFAULT_POLL_INTERVAL_SECONDS (60s/2s): the 60s timeout has real headroom above the ~8.5-8.9s measured end-to-end restart time above (measured twice, one instance, one OctoBot version -- some margin is appropriate, not treated as a tight bound); the 2s poll interval reliably samples within the ~6.3-6.7s measured outage window. Still treat both as informed-but-limited defaults (n=2, single instance/version), not a guaranteed bound for every OctoBot deployment -- override both per-call if your own environment differs materially.

Not confirm-gated (a read-only poll). Returns {"ready": true|false, "elapsed_seconds": float, "attempts": int} -- all fields reflect this loop's REAL timing/attempt count, never fabricated.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeout_secondsNo
poll_interval_secondsNo

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  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?

With no annotations provided, the description carries the full behavioral burden and does so thoroughly: it discloses that the loop is bounded, never raises on timeout, returns an honest false, requires at least one failed poll before ready:true, and clarifies that 'ready' only means the HTTP server answered after a confirmed outage. This is exceptionally transparent about edge cases and limitations.

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?

The description is front-loaded with the core purpose and then provides deeply relevant behavioral, correctness, and parameter context. It is long and contains project-specific references (ADR-0010, NFR-3, open question #14) that could be condensed without losing operational value, so it is not maximally concise.

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 no output schema and no annotations, the description is unusually complete: it specifies return fields, timing semantics, failure behavior, default reasoning, measurement caveats, and a confirmed limitation. Nothing an agent needs to invoke this tool correctly or interpret its result is missing.

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?

Schema coverage is 0%, so the description must compensate, and it does. It explains the default timeout and poll interval, why those values were chosen, gives measured real-world timing context, and instructs users to override both per-call if their environment differs materially.

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 sentence states a specific verb and resource: polls for OctoBot's HTTP server becoming reachable again after a restart. It also clarifies the exact meaning of 'ready' and distinguishes this tool from generic polling or restart tools in the sibling list.

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?

The description clearly frames when this tool applies (after a restart) and explicitly warns against using it as a fix for evaluator/strategy-composition tuning validation. It does not name an alternative sibling tool, but it gives strong context about its intended pairing with restart_octobot and its read-only nature.

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