Skip to main content
Glama

guard_example

Save a bad example as a guard only when a named rule catches it, turning the case into a regression test that must fail.

Instructions

Close a bad example: name the rule that catches it. The example is run as its own document (render rules too) and the guard is saved only if that rule fires on it, like a regression test that must fail on the bad case.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "id": "<id>",
      "rule": "<rule>"
    },
    "name": "guard_example"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYes
howNo
ruleYesRule id: built-in (layout/collision), taste/<id> or project/<id> (a code rule)
basisNoWhat you read and followed to make this change, as refs from search or lookup: rule:<lint or taste rule>, taste, feedback:<id> (earlier feedback this follows; what it answers goes in feedback), commit:<id> (an earlier change it builds on), asset:, template:, skill:… The person sees them under the change, so they know why it is this way. Name only what shaped it.
messageNoOne line saying why, kept with the change in the history
feedbackNoIds of the feedback this change answers (notes and marks from list_notes, list_examples or the conversation). When the person keeps the change it joins the record of that feedback, and when they then mark the feedback resolved it is the fix; when they take it back, the feedback opens again.
confidenceNoHow sure you are this change is what the person wants. high: they asked for exactly this, or you measured it against a reference. medium: you inferred it from the taste, a rule or earlier feedback. low: you are guessing, or it changes something they did not ask about. The person's threshold decides which changes stand by themselves and which wait for them to keep; say it honestly on every change.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.2
    • addedInput schema / properties / confidence
      Added value: +{
      +  "description": "How sure you are this change is what the person wants. high: they asked for exactly this, or you measured it against a reference. medium: you inferred it from the taste, a rule or earlier feedback. low: you are guessing, or it changes something they did not ask about. The person's threshold decides which changes stand by themselves and which wait for them to keep; say it honestly on every change.",
      +  "enum": [
      +    "high",
      +    "medium",
      +    "low"
      +  ]
      +}
    • changedInput schema / properties / rule / description
      Previous value: -"Rule id, e.g. layout/collision"New value: +"Rule id: built-in (layout/collision), taste/<id> or project/<id> (a code rule)"
  2. First observedv0.1.0

TDQS

A3.5/5.0
Behavior4/5

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

Annotations declare the safety profile (readOnlyHint=false, destructiveHint=false, idempotentHint=false), and the description adds genuinely new behavior: the example is evaluated as its own document including render rules, and the guard is persisted only when the rule fires. This conditional side-effect is exactly the kind of context annotations cannot carry. It stops short of saying what is returned or what happens to the example when the rule does not fire.

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?

Two sentences, front-loaded with the action, then the mechanics and the regression-test analogy. No filler, and the analogy does real explanatory work in a few words.

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

Completeness3/5

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

For a mutation tool with no output schema and seven parameters, the description covers the central conditional behavior well. However, it leaves open what the caller sees on failure (error vs. silent no-op) and whether 'closing' the example changes its own state, both of which matter for a write operation. Adequate but with clear gaps.

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 71%, so the schema already documents rule, basis, message, feedback, and confidence in depth. The description reinforces the rule parameter ('name the rule that catches it') but adds nothing for id or how, the two parameters left undescribed in the schema. With a moderate coverage gap, the description only partially compensates.

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?

The description names the action (close a bad example by attaching a guard) and the mechanism (name the rule that catches it), which is specific enough to distinguish it from sibling check_* tools. The verb 'close' is somewhat domain jargon, but the following sentences define it operationally, so a reader can tell what the tool produces.

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

Usage Guidelines2/5

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

The description states a precondition for success (the rule must fire on the example, or the guard is not saved) but gives no guidance on when to pick this over check_examples, check_lint_rule, or accept_rule. There are no exclusions or named alternatives, so the agent must infer the selection criteria from sibling names alone.

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

Deploy Server

Other Tools