Skip to main content
Glama

Diagnose a shot

diagnose_shot
Read-onlyIdempotent

Evaluate shot metrics to provide ranked hypotheses (C6) and warn on flip-flops (G2) or fatigue (G6). Resolves the SHOT's own bean (age computed at the shot's pulled_at), never the active profile, and echoes it as bean_context, so diagnosing an older or differently-filed shot is always safe. The engine reads metrics and sensory tags, NOT free-text notes, so make sure taste feedback is recorded as sensory_tags on the shot (via log_shot or update_shot) before diagnosing; otherwise an in-range shot that tastes bad will come back "balanced".

Input Schema

NameRequiredDescriptionDefault
shot_idNoOptional shot ID; defaults to last pulled shot.

Output Schema

NameRequiredDescriptionDefault
factsYes
categoryYes
warningsYes
hypothesesYes
kb_versionYes
bean_contextYes
warning_codesYes
one_variable_onlyYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / warning_codes
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "category",
      -  "facts",
      -  "hypotheses",
      -  "warnings",
      -  "one_variable_only",
      -  "kb_version",
      -  "bean_context"
      -]New value: +[
      +  "category",
      +  "facts",
      +  "hypotheses",
      +  "warnings",
      +  "one_variable_only",
      +  "kb_version",
      +  "warning_codes",
      +  "bean_context"
      +]
  2. Changed2 schema fields changed
    • addedOutput schema / properties / bean_context / properties / bag_id
      Added value: +{
      +  "type": "integer"
      +}
    • changedOutput schema / properties / bean_context / required
      Previous value: -[
      -  "bean_id",
      -  "bean_name",
      -  "roast_level",
      -  "effective_age_days",
      -  "dial_category"
      -]New value: +[
      +  "bean_id",
      +  "bag_id",
      +  "bean_name",
      +  "roast_level",
      +  "effective_age_days",
      +  "dial_category"
      +]
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "bean_context": {
      +      "additionalProperties": true,
      +      "properties": {
      +        "bean_id": {
      +          "type": "integer"
      +        },
      +        "bean_name": {
      +          "type": "string"
      +        },
      +        "dial_category": {
      +          "type": "string"
      +        },
      +        "effective_age_days": {
      +          "type": "integer"
      +        },
      +        "roast_level": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "bean_id",
      +        "bean_name",
      +        "roast_level",
      +        "effective_age_days",
      +        "dial_category"
      +      ],
      +      "type": "object"
      +    },
      +    "category": {
      +      "type": "string"
      +    },
      +    "facts": {
      +      "items": {
      +        "additionalProperties": true,
      +        "properties": {
      +          "source": {
      +            "type": "string"
      +          },
      +          "text": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "text",
      +          "source"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "hypotheses": {
      +      "items": {
      +        "additionalProperties": true,
      +        "properties": {
      +          "cause": {
      +            "type": "string"
      +          },
      +          "cited_rules": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          },
      +          "confidence": {
      +            "type": "string"
      +          },
      +          "direction": {
      +            "type": "string"
      +          },
      +          "experiment": {
      +            "type": "string"
      +          },
      +          "lever": {
      +            "type": "string"
      +          },
      +          "target_label": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "cause",
      +          "lever",
      +          "direction",
      +          "confidence",
      +          "experiment",
      +          "cited_rules"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "kb_version": {
      +      "type": "string"
      +    },
      +    "one_variable_only": {
      +      "type": "boolean"
      +    },
      +    "warnings": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "category",
      +    "facts",
      +    "hypotheses",
      +    "warnings",
      +    "one_variable_only",
      +    "kb_version",
      +    "bean_context"
      +  ],
      +  "type": "object"
      +}
  4. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), and the description adds real substance beyond them: bean resolution semantics, the echo of bean_context, and the fact that the engine ignores free-text notes. It does not discuss output shape or confidence limits, but the added context is well above the annotation baseline.

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?

Three tight sentences, front-loaded with the core function and warnings, then scope, then the prerequisite. The rule codes (C6/G2/G6) are opaque without KB context and occupy space that could be plainer, but there is no filler.

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?

An output schema exists, so return values need not be explained, and the description supplies the missing behavioral context: bean resolution, the sensory_tags requirement, and what warnings to expect. Adequate for a zero-required-param read tool, with only the sibling routing left implicit.

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 coverage is 100% and the single parameter's default (last pulled shot) is documented in the schema itself. The description adds no independent detail about shot_id, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: evaluate shot metrics and return ranked hypotheses plus flip-flop/fatigue warnings. The scope clarification (resolves the shot's own bean, not the active profile) helps separate it from a preview-style diagnosis, but it never explicitly names diagnose_preview as the alternative.

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?

Gives a concrete prerequisite: sensory feedback must be recorded as sensory_tags on the shot via log_shot/update_shot before calling, otherwise bad-tasting in-range shots come back 'balanced'. That is a clear use condition, though it stops short of stating when to prefer this over diagnose_preview.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources