Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
AGENT_NAMEYesThe name identifying the agent host that mounts the FerryCat MCP server (e.g. "antigravity", "workbuddy"). Configured per host in the host's MCP settings.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
dispatch_contractA

Dispatch a task or code review contract to another local AI agent host via the shared SQLite WAL mesh.

Purpose

Registers a new contract in SUBMITTED status with full-file SHA-256 fingerprint snapshots of all target files, establishing an immutable baseline for cross-host verification and emitting active pointer overlap warnings.

Usage Guidelines

  • When to use: Use when requesting code reviews, architecture audits, implementation, or test generation from a target agent (e.g., target_agent="workbuddy" or "antigravity").

  • Mutation Write Modes (ADR-0006 / ADR-0007):

    • write_mode="direct" (default for implementation / test_generation): Worker edits pointer files directly on disk and commits post-mutation SHA-256 hashes at fulfill time.

    • write_mode="proposal": Worker is forbidden from editing disk files and must deliver a unified git diff in proposed_patch; requester reviews and atomically applies it via apply_contract_patch. Recommended when concurrent agents share workspace_root.

  • When NOT to use:

    • Do NOT use to claim or execute tasks (use poll_next_task).

    • Do NOT use to check task status or inspect outputs (use inspect_mesh_state).

    • Do NOT pass write_mode on read-only tasks (code_review / architecture_audit).

Behavior & Side Effects

  • Mutates local SQLite database (~/.ferrycat/mesh.db) only; makes zero network requests.

  • Active Pointer Overlap Detection (ADR-0007): Checks non-expired SUBMITTED / CLAIMED contracts in the same workspace_root and populates overlapping_contracts + warning if pointer files intersect.

Return Value

Returns { contract_id, status: 'SUBMITTED', created_at, write_mode?, files, patch_sha256?, patch_bytes?, overlapping_contracts?, warning? }.

poll_next_taskA

Atomically claim the oldest pending SUBMITTED contract assigned to this agent and verify local file fingerprints.

Purpose

Retrieves and claims next available contract work for the current agent, transitioning it from SUBMITTED to CLAIMED.

Usage Guidelines

  • When to use: Call to discover and atomically take ownership of pending tasks assigned to your agent_id.

  • When NOT to use:

    • Do NOT use to non-destructively inspect queue depth or monitor status without claiming (use inspect_mesh_state).

    • Do NOT use to create contracts (use dispatch_contract).

  • Delivery Track Rules (check contract.task_type & contract.write_mode):

    • Read-only tasks (code_review / architecture_audit): NEVER edit pointer files on disk; place suggested diffs in structured_output.fixes (ADR-0004).

    • Mutation tasks with write_mode="direct": Edit target files on disk; post-mutation SHA-256 hashes are snapshotted at fulfill_contract (ADR-0006).

    • Mutation tasks with write_mode="proposal": NEVER edit pointer files on disk; deliver a unified diff via proposed_patch in fulfill_contract (ADR-0007).

Return Value

  • When work is claimed: { has_task: true, status: 'CLAIMED', contract: { contract_id, requester_agent, target_agent, task_type, write_mode, title, context_summary, workspace_root, pointers, contract_schema, claimed_at, exec_ttl_sec, claim_token } }.

  • When stale or empty: { has_task: false, status?, stale_error?, remediation?, message? }.

fulfill_contractA

Submit execution or review deliverables for a CLAIMED contract under Dual-Track TOCTOU verification (ADR-0004 / ADR-0006 / ADR-0007) and Ajv JSON Schema validation.

Purpose

Delivers task outputs, enforces track-specific workspace integrity and cryptographic SHA-256 auditing, validates structured payloads, and transitions the contract to terminal COMPLETED.

Track-Specific Fulfillment Rules

  1. Track A — Read-Only Audit (code_review | architecture_audit, ADR-0004):

    • Pointer files on disk MUST remain 100% unchanged (verifyAllPointers). Pass suggested code fixes in structured_output.fixes.

    • Accidental disk edits trigger a 1-strike recoverable RETRY_NEEDED buffer (restore via git checkout/stash, call verify_contract, then retry); a 2nd dirty attempt transitions to terminal POINTER_STALE while salvaging your output.

  2. Track B1 — Direct Mutation (implementation | test_generation with write_mode="direct", default, ADR-0006):

    • Editing pointer files on disk and creating declared artifacts_pointers files is expected and permitted (SECURITY_REJECTED and FILE_MISSING remain hard blockers).

    • Post-mutation full-file SHA-256 hashes are committed into verified_sha256 while pointers preserves the pre-mutation baseline.

  3. Track B2 — Zero-Write Proposal Mode (implementation | test_generation with write_mode="proposal", ADR-0007):

    • Pointer files on disk MUST remain 100% unchanged (enforced by the same 1-strike TOCTOU guard as Track A).

    • You MUST provide a valid non-empty unified git diff (<= 512KB) in proposed_patch touching only safe workspace paths and declared existing pointer files (or new files from /dev/null). Missing or invalid patches return recoverable RETRY_NEEDED (remediation.action="FIX_PATCH_AND_RESUBMIT").

Return Value

Returns { ok, contract_id, status: 'COMPLETED' | 'RETRY_NEEDED' | 'POINTER_STALE' | 'VALIDATION_FAILED' | 'TIMED_OUT', retry_count, max_retries, toctou_strike?, max_toctou_strikes?, dirty_files?, validation_errors?, no_op?, proposed_patch_sha256?, proposed_patch_bytes?, remediation?, message }.

inspect_mesh_stateA

Strictly read-only query of contracts, execution progress, outputs, proposal patches, diagnostic counters, and failure causes.

Purpose

Provides comprehensive observability into the multi-agent mesh state without acquiring database write locks or mutating rows.

Behavior & Side Effects

  • Zero side effects: Pure read-only SELECT query against local SQLite WAL. Never alters rows or triggers sweeps.

  • Pass include_patch=true to expand raw git_patch and proposed_patch payloads (omitted by default to conserve context tokens).

Return Value

Returns { total_returned, contracts: Array<{ contract_id, requester_agent, target_agent, task_type, write_mode, title, status, is_logically_expired, created_at, claimed_at, completed_at, proposal_applied_at, retry_count, extend_count, release_count, toctou_strike, result_summary, structured_output, artifacts_pointers, proposed_patch_sha256, proposed_patch_bytes, proposed_patch?, error_reason, salvaged_result, verified_sha256 }> }.

release_contractA

Hand a CLAIMED contract back to the queue tail as SUBMITTED with a fresh queue window.

Behavior & Side Effects

  • Mutates database: Resets claimed_at=NULL, claim_token=NULL, updates queued_at=nowMs, resets extend_count=0 and toctou_strike=0, and increments release_count.

  • Preserves contract-level retry_count so schema validation retries cannot be laundered across releases.

  • Limits: Maximum 3 releases per contract; refused once past created_at + 4 * queue_ttl_sec.

Return Value

Returns { ok, contract_id, status: 'SUBMITTED' | 'CLAIMED' | 'TIMED_OUT', release_count, max_releases, remediation?, message }.

extend_ttlA

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

Behavior & Side Effects

  • Mutates database: Resets claimed_at=nowMs and increments extend_count (max 5 renewals per holder, bounded by created_at + 4 * queue_ttl_sec).

Return Value

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

fail_contractA

Explicitly mark a CLAIMED contract as terminal FAILED with a mandatory failure reason.

Behavior & Side Effects

  • Destructive terminal transition: Sets status='FAILED', error_reason='WORKER_FAILED: ', and completed_at=nowMs.

Return Value

Returns { ok, contract_id, status: 'FAILED' | 'TIMED_OUT', remediation?, message }.

verify_contractA

Read-only pre-flight and post-completion consistency check (ADR-0004 / ADR-0006 / ADR-0007): audits on-disk pointer files against the contract's SHA-256 baseline or committed post-mutation snapshot.

Behavior & Side Effects

  • Zero side effects: Pure read-only operation. Never updates SQLite state and never consumes a TOCTOU strike.

  • Track-aware verification:

    • Read-only tasks & CLAIMED write_mode="proposal" contracts: checks immutable baseline SHA-256.

    • CLAIMED write_mode="direct" mutation contracts: checks path safety & file existence while reporting modified files.

    • COMPLETED mutation contracts: verifies on-disk files against committed verified_sha256.

Return Value

Returns { ok: true, valid, fulfillable, contract_id, status, target_agent, toctou_strike, max_toctou_strikes, dirty_files, remediation?, message }.

apply_contract_patchA

Verify the cryptographic dispatch baseline SHA-256 lock and atomically apply a COMPLETED contract's proposed_patch to workspace_root via git apply (ADR-0007).

Purpose

Completes the zero-write proposal loop (write_mode="proposal") by allowing the requester host to dry-run or atomically land a worker's unified diff only when the local baseline has not drifted.

Strict Preconditions & Safety Gates

  1. Contract must be in COMPLETED status with write_mode="proposal", non-empty proposed_patch, and proposal_applied_at === null (refuses duplicate application with ALREADY_APPLIED).

  2. Baseline Drift Lock: Every existing pointer file touched by proposed_patch must currently match its exact dispatched SHA-256 in pointers_json, and newly created files must not already exist on disk. Any drift immediately aborts with status="PROPOSAL_CONFLICT" (zero fuzzy merging, zero overwrites).

  3. Runs "git apply --check" in workspace_root; when dry_run is false, executes "git apply", computes post-apply SHA-256 hashes into verified_sha256, and records proposal_applied_at.

Return Value

Returns { ok, contract_id, status: 'APPLIED' | 'DRY_RUN_OK' | 'ALREADY_APPLIED' | 'PROPOSAL_CONFLICT' | 'PRECONDITION_FAILED', dry_run, proposed_patch_sha256?, proposal_applied_at?, touched_files?, verified_sha256?, drifted_files?, git_check_error?, remediation?, message }.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4.3/5.0

Scored across 9 tools

Disambiguation5/5

Each tool owns a distinct lifecycle step (dispatch, poll/claim, fulfill, release, extend, fail, verify, inspect, apply patch), and the descriptions explicitly add 'when NOT to use, use tool X instead' cross-references, which sharply separates the read-only pairs (inspect_mesh_state vs verify_contract) and the queue-management pairs (release_contract vs fail_contract).

Naming Consistency5/5

All nine names are snake_case verb-first constructions (dispatch_contract, fulfill_contract, apply_contract_patch, verify_contract, etc.), with the noun consistently identifying the subject (contract/task/ttl/mesh_state). The only variation is poll_next_task, which is still clearly verb-first and readable.

Tool Count5/5

Nine tools map cleanly onto one contract's full lifecycle plus two read-only observability operations — no padding and nothing feels missing from the set. The count sits comfortably in the well-scoped 3-15 range.

Completeness4/5

The surface covers dispatch → claim → fulfill/verify → apply/discard → terminal outcomes with retry, TTL, and failure paths well. The one gap is that a SUBMITTED (unclaimed) contract has no cancel/withdraw operation, so a requester who dispatched in error must wait for it to time out.

Maintenance

ActivityNo data
ResponsivenessOutdated data