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

TableJSON Schema
NameRequiredDescriptionDefault
shot_idNoOptional shot ID; defaults to last pulled shot.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
factsYes
categoryYes
warningsYes
hypothesesYes
kb_versionYes
bean_contextYes
one_variable_onlyYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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"
      +]
  2. 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"
      +}
  3. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover safety (readOnly, idempotent), but the description adds substantial behavioral context: the engine reads metrics and sensory tags rather than free-text notes, bean age is computed at pulled_at and echoed as bean_context, and never uses the active profile. These are non-obvious traits that materially affect correct invocation.

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 sentences, front-loaded with the core purpose and outputs, followed by the bean-resolution guarantee and the critical sensory_tags prerequisite. Dense but each clause carries real information; the final sentence is long yet justified.

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?

An output schema exists so return values need not be explained, and the description covers the preconditions and the bean-context behavior an agent needs. Nothing required to call this correctly is 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?

With a single parameter at 100% schema coverage, the schema already documents that shot_id defaults to the last pulled shot. The description adds no syntax or format detail beyond that, so the baseline of 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?

States a specific verb and resource ('Evaluate shot metrics') plus the concrete outputs (ranked hypotheses C6, flip-flop/fatigue warnings). An agent can distinguish this from list_shots or get_stats without opening the schema.

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?

Gives an explicit prerequisite chain: taste feedback must be recorded as sensory_tags via log_shot or update_shot before diagnosing, otherwise results are wrong. It also reassures that diagnosing older or differently-filed shots is safe, covering the main decision points.

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