INNER CODE UNIT · Python

ping_sandbox

deeplethe/forkd · sdk/mcp/sandstorm_mcp/server.py:373

def ping_sandbox(sandbox_id: str, sandbox_token: str | None = None) -> dict[str, Any]:
    """Check a sandbox answers.

    sandbox_token: Token from the creation response; required by v0.6.

    Returns: {ok, tier, guest_addr, latency_ms}. ok says whether something
    accepts connections on the sandbox's port, so it stays false in a running
    sandbox that serves nothing.
    """
    with _client(sandbox_token) as c:
        r = c.post(f"/v1/sandboxes/{sandbox_id}/ping")
        r.raise_for_status()
        return r.json()


def main() -> None:
    """Entrypoint for the `sandstorm-mcp` console script."""
    mcp.run()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…