Skip to main content
Glama

ivd_judgment_inject_context

Retrieves prioritized judgment context—distilled patterns, recent corrections, rejected hypotheses, and corroborated approaches—to inject into an AI agent's system message before a run.

Instructions

Return prioritized Judgment context for downstream agents. Four layers: (1) distilled patterns (active, freshness ∈ {fresh, aging}, sorted by weighted_confidence × member_count), (2) recent codified corrections in the same domain (last 5), (3) ruled_out — REJECTED comparison-pair hypotheses (do-not-retry veto), (4) What Works hypotheses (only corroborated comparison pairs). Soft token_budget cap. Use this to inject judgment knowledge into the next agent run's system message. Dormant unless .judgment/ exists. (IVD v3.0)

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": "ivd_judgment_inject_context"
  }
}

Input Schema

NameRequiredDescriptionDefault
domainNoOptional: filter all layers to one domain.
task_typeNoOptional: task context hint (e.g. 'generate-script'). Echoed back in response; reserved for task-scoped injection in a future release.
project_rootNoOptional path to repo root.
token_budgetNoSoft token budget for the rendered context (default 1500).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.1.2

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses layer composition, sorting formula, freshness filter, the 'do-not-retry veto' meaning of ruled_out, the corroboration requirement for What Works, and that token_budget is a soft cap. It stops short of stating whether the call is side-effect free or whether it touches `.judgment/` state, which for a context-fetch tool would close the loop.

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?

Front-loaded with the core action, then a compact numbered breakdown of layers, then usage and gating caveats, then a version tag. Dense but every clause carries information; nothing is 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?

No output schema exists, yet the description fully specifies what comes back (four layers, filtering and sort rules, truncation behavior via soft budget). That is complete for an agent to call it correctly with zero required parameters.

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 four optional parameters are already documented. The description reinforces 'soft token_budget cap' and the domain scoping of all layers, but adds no syntax, format, or default nuance 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?

States a specific verb and resource ('Return prioritized Judgment context') and then enumerates the exact four layers of that context, including ordering (weighted_confidence × member_count) and freshness filter. An agent can tell this apart from capture/codify/check_installed siblings without reading their schemas.

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

Usage Guidelines4/5

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

Explicitly says the purpose is to 'inject judgment knowledge into the next agent run's system message' and adds a clear gating condition ('Dormant unless `.judgment/` exists'). It names no sibling alternative for the case where `.judgment/` is absent (e.g., ivd_judgment_check_installed or ivd_judgment_init), so routing guidance is strong but not complete.

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