Skip to main content
Glama

extend_ttl

Resets the active execution window of a CLAIMED contract to prevent timeout during long-running tasks. Call periodically before the execution countdown expires as a heartbeat renewal.

Instructions

Heartbeat renewal for long-running execution: restarts the active execution window of a CLAIMED contract.

Purpose

Prevents execution timeout during deep reasoning, extensive test execution, or complex multi-step refactoring by resetting the execution clock.

Usage Guidelines

  • When to use: Call periodically during long-running tasks before the active exec_ttl_sec countdown expires.

  • When NOT to use:

    • Do NOT use after the window has already expired (expired contracts transition to TIMED_OUT).

    • Do NOT use to deliver task completion (use fulfill_contract).

    • Do NOT use if abandoning the task (use release_contract or fail_contract).

  • Prerequisites: Caller must be the current holder and contract must be currently CLAIMED.

Behavior & Side Effects

  • Mutates database: Resets claimed_at=nowMs (restarting the full exec_ttl_sec window from the current moment) and increments extend_count.

  • Quotas & Boundaries: Maximum 5 renewals per holder. Bounded by the contract's absolute lifetime ceiling (created_at + 4 * queue_ttl_sec); rejected if proposedExpiresAt > lifetimeDeadline.

Return Value

Returns { ok: boolean, contract_id: string, status: 'CLAIMED' | 'TIMED_OUT', claimed_at?: number, expires_at?: number, extend_count: number, max_extends: number, message: string }.

Input Schema

NameRequiredDescriptionDefault
agent_idNoCurrent holder agent identifier. Must match target_agent of the claimed contract (defaults to AGENT_NAME env var).
claim_tokenNoExclusive lease token returned in contract.claim_token by poll_next_task (FC-301).
contract_idYesThe CLAIMED contract ID whose active execution window should be renewed.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.2
    • addedInput schema / properties / claim_token
      Added value: +{
      +  "description": "Exclusive lease token returned in contract.claim_token by poll_next_task (FC-301).",
      +  "maxLength": 128,
      +  "minLength": 1,
      +  "type": "string"
      +}
  2. Addedv0.3.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and delivers: it discloses the database mutation (claimed_at=nowMs reset, extend_count increment), hard quotas (max 5 renewals per holder), an absolute lifetime ceiling (created_at + 4 * queue_ttl_sec), and the rejection condition. It also warns that expiry transitions the contract to TIMED_OUT.

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?

Content is front-loaded with the core action and organized under clear headings, and virtually every line carries operational information. The markdown-section framing is heavier than necessary for a tool description and the return-value block is dense, but nothing is truly redundant.

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?

For a mutation tool with no annotations and no output schema, the description supplies the missing pieces: side effects, quota limits, failure conditions, prerequisites, and an explicit return shape. An agent has everything needed to call it correctly and to anticipate rejections.

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 already documents contract_id, agent_id, and claim_token in detail; baseline is 3. The description adds the holder-must-match precondition but never explains claim_token's lease role, and it references 'proposedExpiresAt' which is not an input in the schema, a minor source of confusion.

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 resource ('Heartbeat renewal ... restarts the active execution window of a CLAIMED contract') and immediately frames it as timeout prevention. It is clearly distinguishable from siblings that deliver, release, or fail a contract, which are named later.

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 when-to-use ('periodically during long-running tasks before the active exec_ttl_sec countdown expires') and three when-NOT-to-use cases, each routing to a concrete sibling (fulfill_contract, release_contract, fail_contract). Prerequisites are stated: caller must be current holder and contract must be CLAIMED.

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