Skip to main content
Glama

inspect_mesh_state

Query contract status, execution progress, outputs, diagnostics, and failure causes without locks or mutations; use it to check claimed/completed tasks and monitor queue depth.

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 }> }.

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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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"
      +}
  2. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden and does so well: it states zero side effects, a pure read-only SELECT against SQLite WAL, no row mutation, no sweeps, and no database locks. It also explains the dynamic is_logically_expired calculation based on queue or execution TTL, which is non-obvious behavior an agent would otherwise miss.

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 front-loaded with the core read-only purpose and then organized into clear sections for usage, behavior, and return value. The return-value structure is detailed but earns its place because there is no output schema.

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?

Given the lack of annotations and output schema, the description is complete enough for correct invocation: it covers purpose, alternatives, side effects, lock behavior, expiration logic, and the returned object shape. No critical context for a 4-parameter optional-filter observability tool appears to be missing.

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 all four parameters are already documented in the schema; the baseline is therefore 3. The description adds some meaning by explaining the target_agent filter for monitoring a specific agent’s queue, but it does not add much beyond the schema for limit, status, or contract_id.

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 description states a specific verb and resource: a strictly read-only query of contracts, execution progress, outputs, diagnostic counters, and failure causes in the multi-agent mesh state. It clearly distinguishes the tool from sibling operations by naming poll_next_task, dispatch_contract, and verify_contract as alternatives for other purposes.

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 explicit when-to-use cases such as checking whether a dispatched contract was claimed or completed, inspecting result summaries, and monitoring queue depth via target_agent. It also gives explicit when-not-to-use cases with named alternatives for claiming, dispatching, and verifying file pointer hygiene.

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