Skip to main content
Glama

inspect_mesh_state

Query contract status, execution progress, outputs, diagnostic counters, and failure causes read-only, without locks or row changes, to monitor multi-agent mesh state.

Instructions

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

Purpose

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

Usage Guidelines

  • When to use:

    • Check whether a contract you dispatched has been claimed or completed.

    • Inspect result summaries, structured outputs, or salvaged results of completed/stale contracts.

    • Monitor queue depth or pending contracts for a specific agent via target_agent filter.

  • When NOT to use:

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

    • Do NOT use to dispatch tasks (use dispatch_contract).

    • Do NOT use to verify on-disk file pointer hygiene (use verify_contract).

Behavior & Side Effects

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

  • Dynamically calculates is_logically_expired: true when a contract has exceeded its queue or execution TTL based on the current timestamp, even before the next lazy sweep runs.

Return Value

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

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "inspect_mesh_state"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum number of records to return (default: 10)
statusNoFilter by status (default: ALL)
contract_idNoOptional specific contract_id to inspect single contract details, counters, errors, and output payloads.
target_agentNoOptional filter by target worker agent identifier (e.g., "workbuddy") to view pending or completed queue items.
include_patchNoWhen true, includes the raw git_patch string in each inspected contract (default: false to avoid large inline responses).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.0
    • addedInput schema / properties / include_patch
      Added value: +{
      +  "description": "When true, includes the raw git_patch string in each inspected contract (default: false to avoid large inline responses).",
      +  "type": "boolean"
      +}
  2. Changed3 schema fields changedv0.3.0
    • changedInput schema / properties / contract_id / description
      Previous value: -"Optional specific contract_id to inspect"New value: +"Optional specific contract_id to inspect single contract details, counters, errors, and output payloads."
    • changedInput schema / properties / status / enum
      Previous value: -[
      -  "SUBMITTED",
      -  "CLAIMED",
      -  "COMPLETED",
      -  "POINTER_STALE",
      -  "VALIDATION_FAILED",
      -  "TIMED_OUT",
      -  "ACTIVE",
      -  "ALL"
      -]New value: +[
      +  "SUBMITTED",
      +  "CLAIMED",
      +  "COMPLETED",
      +  "POINTER_STALE",
      +  "VALIDATION_FAILED",
      +  "TIMED_OUT",
      +  "FAILED",
      +  "ACTIVE",
      +  "ALL"
      +]
    • addedInput schema / properties / target_agent
      Added value: +{
      +  "description": "Optional filter by target worker agent identifier (e.g., \"workbuddy\") to view pending or completed queue items.",
      +  "maxLength": 64,
      +  "minLength": 1,
      +  "type": "string"
      +}
  3. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so: it declares zero side effects, no database locks, no row mutation, no sweep triggering, and READ-only access against SQLite WAL. It also discloses a non-obvious derived behavior — is_logically_expired being computed from current timestamp ahead of the lazy sweep — which an agent could not infer from the schema.

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?

Headers (Purpose, Usage Guidelines, Behavior, Return Value) front-load the read-only guarantee in the very first sentence, and each section is scannable bullet content rather than prose. The long return-field enumeration earns its place because no output schema exists to carry that information.

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 five-parameter observability tool with no annotations and no output schema, the description covers what the tool does, when to use it, what it will not do, and the exact return shape — including total_returned and the per-contract field list. Nothing an agent needs in order to call this correctly appears to be missing.

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?

Schema coverage is 100%, so the baseline is 3; the description adds modest value on top by tying target_agent to the queue-depth monitoring use case and framing contract_id inspection implicitly through the return-field list. It does not explain limit/pagination interaction or status enum semantics (e.g., how ALL differs from ACTIVE) beyond what the schema states.

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?

The opening sentence names a specific verb ('read-only query') and enumerates the resources covered: contracts, execution progress, outputs, diagnostic counters, failure causes. The Purpose section adds scope ('multi-agent mesh state') and explicitly distinguishes itself from siblings by naming poll_next_task, dispatch_contract, and verify_contract in the when-not-to-use list.

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?

It gives three concrete when-to-use conditions (checking claim/completion, inspecting result payloads, monitoring queue depth via target_agent) and three explicit when-not-to-use exclusions that route to the correct sibling for each alternative action. This is exactly the routing guidance an agent needs to choose among eight siblings.

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