Skip to main content
Glama

pot_health

Monitor Proof of Time system health by checking time source status, subgraph synchronization, server uptime, and operational mode.

Instructions

Check PoT system health: time source status, subgraph sync, server uptime, and current mode.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function 'potHealth' that checks the health of time synthesis sources, subgraph indexing status, and general server metrics.
    export async function potHealth(): Promise<unknown> {
      telemetryIncrement("pot_health");
    
      let timeStatus = "unknown";
      let synthSources = 0;
      try {
        const synth = await Promise.race([
          timeSynth.synthesize(),
          new Promise<null>((_, reject) =>
            setTimeout(() => reject(new Error("timeout")), 5000)
          ),
        ]);
        if (synth && synth.sources >= 2) {
          timeStatus = "healthy";
          synthSources = synth.sources;
        } else {
          timeStatus = "degraded";
          synthSources = synth?.sources ?? 0;
        }
      } catch {
        timeStatus = "unhealthy";
      }
    
      let latestBlock = 0;
      let syncStatus = "unknown";
      try {
        const query = `{ _meta { block { number } hasIndexingErrors } }`;
        const controller = new AbortController();
        const timeout = setTimeout(() => controller.abort(), 5000);
        const resp = await fetch(SUBGRAPH_URL, {
          method: "POST",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify({ query }),
          signal: controller.signal,
        });
        clearTimeout(timeout);
    
        if (resp.ok) {
          const json = (await resp.json()) as {
            data?: { _meta?: { block?: { number: number }; hasIndexingErrors?: boolean } };
          };
          latestBlock = json.data?._meta?.block?.number ?? 0;
          syncStatus = json.data?._meta?.hasIndexingErrors ? "indexing_errors" : "synced";
        }
      } catch {
        syncStatus = "unreachable";
      }
    
      const uptimeMs = Date.now() - startedAt;
    
      return serialize({
        status: timeStatus === "healthy" ? "ok" : timeStatus,
        timeSources: { status: timeStatus, activeSources: synthSources },
        subgraph: { latestBlock, syncStatus },
        server: {
          uptime: uptimeMs,
          uptimeHuman: `${(uptimeMs / 3600000).toFixed(1)}h`,
          potCount: potLog.length,
          currentMode: adaptiveSwitch.getCurrentMode(),
          signerPubKey: potSigner.getPubKeyHex(),
        },
      });
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions what gets checked (time source status, subgraph sync, server uptime, current mode) but doesn't disclose important behavioral traits like whether this is a read-only operation, if it requires authentication, potential rate limits, or what happens when the system is unhealthy. The description is functional but lacks critical operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose ('Check PoT system health') followed by specific aspects being examined. Every word earns its place with no redundancy or unnecessary elaboration. Perfectly sized for this simple diagnostic tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (no parameters, no output schema, no annotations), the description provides adequate context for what the tool does. However, it lacks information about the return format, error conditions, or what constitutes 'healthy' versus 'unhealthy' states. For a health check tool, knowing what the output looks like would be valuable, especially without an output schema.

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?

The tool has zero parameters with 100% schema description coverage, so the baseline is 4. The description appropriately doesn't discuss parameters since none exist, and it doesn't need to compensate for any schema gaps. This is the correct approach for a parameterless tool.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('Check') and resources ('PoT system health'), listing the specific health aspects examined. It distinguishes from siblings by focusing on system health rather than generation, querying, statistics, or verification. However, it doesn't explicitly differentiate from 'pot_stats' which might also provide health-related statistics.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus its siblings. There's no mention of alternatives, prerequisites, or specific contexts where this health check is appropriate versus using other tools like 'pot_stats' for statistical monitoring or 'pot_verify' for validation checks.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Helm-Protocol/openttt-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server