Skip to main content
Glama

pot_generate

Generate cryptographic Proof of Time for transactions to determine execution order using multiple independent time sources and GRG integrity shards.

Instructions

Generate a Proof of Time for a transaction. Returns potHash, timestamp, stratum, and GRG integrity shards.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
txHashYesTransaction hash (hex with 0x prefix)
chainIdYesChain ID (e.g. 8453 for Base, 84532 for Base Sepolia)
poolAddressYesDEX pool contract address

Implementation Reference

  • tools.ts:43-90 (handler)
    The handler function `potGenerate` which executes the tool logic to generate proof of time and anchor it.
    export async function potGenerate(args: {
      txHash: string;
      chainId: number;
      poolAddress: string;
    }): Promise<unknown> {
      telemetryIncrement("pot_generate");
    
      // 1. Synthesize time from multiple NTP/HTTPS sources
      const pot = await timeSynth.generateProofOfTime();
      const potHash = TimeSynthesis.getOnChainHash(pot);
    
      // 2. GRG pipeline — encode tx data into integrity shards (black box)
      const txData = new TextEncoder().encode(args.txHash);
      const grgShards = GrgPipeline.processForward(txData, args.chainId, args.poolAddress);
    
      // 3. Ed25519 sign the PoT hash for non-repudiation
      const signature = potSigner.signPot(potHash);
    
      // 4. Log the anchor
      const entry: PotAnchorEntry = {
        potHash,
        timestamp: pot.timestamp.toString(),
        stratum: pot.stratum,
        mode: adaptiveSwitch.getCurrentMode(),
        chainId: args.chainId,
        poolAddress: args.poolAddress,
        createdAt: Date.now(),
      };
      potLog.push(entry);
      if (potLog.length > POT_LOG_MAX) potLog.shift();
    
      return serialize({
        potHash,
        timestamp: pot.timestamp.toString(),
        stratum: pot.stratum,
        uncertainty: pot.uncertainty,
        confidence: pot.confidence,
        sources: pot.sources,
        nonce: pot.nonce,
        expiresAt: pot.expiresAt.toString(),
        grgShards: grgShards.map((s: Uint8Array) => Buffer.from(s).toString("hex")),
        signature: {
          issuerPubKey: signature.issuerPubKey,
          signature: signature.signature,
          issuedAt: signature.issuedAt.toString(),
        },
      });
    }
Behavior2/5

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

With no annotations, the description carries full burden but lacks behavioral details. It mentions the return values (potHash, timestamp, stratum, GRG integrity shards) but doesn't disclose critical traits like whether this is a read-only or mutating operation, authentication needs, rate limits, or error conditions. The output description is helpful but insufficient for full transparency.

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 purpose and key output details. Every word earns its place with no redundancy or fluff, making it highly concise and well-structured.

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 3 parameters with full schema coverage and no output schema, the description is minimally adequate. It explains the purpose and outputs but lacks context on when to use, behavioral traits, or error handling. For a tool with no annotations, it should do more to compensate, but the output details provide some completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents parameters (txHash, chainId, poolAddress). The description adds no parameter-specific semantics beyond what the schema provides, such as format examples or constraints. Baseline 3 is appropriate as the schema does the heavy lifting.

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 action ('Generate a Proof of Time') and the resource ('for a transaction'), with specific output details. It distinguishes from siblings like pot_health or pot_stats by focusing on generation rather than monitoring or verification, though it doesn't explicitly contrast with pot_query or pot_verify.

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?

No guidance is provided on when to use this tool versus alternatives like pot_verify (which might validate proofs) or pot_query (which might retrieve existing proofs). The description implies usage for generating proofs but offers no context about prerequisites, timing, or exclusions.

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