Skip to main content
Glama

Inspect Mesh State

inspect_mesh_state
Read-onlyIdempotent

Query multi-agent mesh state read-only to review contracts, progress, outputs, patches, diagnostics, and failure causes without database write locks or row changes.

Instructions

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

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 and proposed_patch strings in each inspected contract (default: false to avoid large inline responses).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.6.0
    • changedInput schema / properties / include_patch / description
      Previous value: -"When true, includes the raw git_patch string in each inspected contract (default: false to avoid large inline responses)."New value: +"When true, includes the raw git_patch and proposed_patch strings in each inspected contract (default: false to avoid large inline responses)."
  2. 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"
      +}
  3. 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"
      +}
  4. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so the description is not obligated to re-prove safety. It still adds real value beyond them: pure SELECT against local SQLite WAL, no write locks acquired, no row mutation, no background sweeps triggered, and the token-conservation rationale for omitting patch payloads by default.

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?

Well structured with Purpose / Behavior / Return Value headings and the key fact (read-only) front-loaded. The Return Value section enumerates roughly two dozen field names without explanation, which is somewhat bloated, though defensible given there is no output schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Because no output schema exists, documenting the return envelope and field list is justified and does most of the completeness work. Remaining gaps are semantic: the meaning of enum states like POINTER_STALE, ACTIVE, or toctou_strike is left unexplained, which matters for a diagnostic tool.

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 five parameters are already documented in the schema, including the include_patch trade-off and limit default. The description restates include_patch but adds no new syntax, format, or interaction semantics (for example how status=ACTIVE or POINTER_STALE are interpreted). Baseline 3 applies.

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 (query, read-only) and enumerates the resources (contracts, execution progress, outputs, proposal patches, diagnostic counters, failure causes). The explicit 'read-only' framing cleanly separates it from every sibling, which are mutations (dispatch_contract, apply_contract_patch, fail_contract, verify_contract).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage context is implied through 'Provides comprehensive observability' and the include_patch guidance, so an agent can infer this is the inspection entry point. However, it never states explicitly when to prefer this over a sibling such as poll_next_task, nor any when-not condition (e.g. do not use for claiming work).

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