Skip to main content
Glama

anti_pattern

Capture a tempting-but-wrong move, the mechanism that makes it fail, and the concrete alternative, so later agents recognize and avoid repeating the same pitfall.

Instructions

Record a pitfall: a move that looks right, why it fails, and what to do instead.

For a mistake worth not repeating. A fact that simply holds is a note(); how an analysis ran and what it settled is a reasoning(). Stored as type='anti_pattern' and read back under TEMPTATION / WHY WRONG / INSTEAD; pulse() counts the open ones for a domain and must_read(type='anti_pattern') lists them.

ONE pitfall per memory: a second temptation from the same session is its own anti_pattern(), connected with link_memories().

Returns the new uid and the project it landed in, plus similar when the store already holds something close: correct, drop or link it as similar_hint says. A field over its ceiling is refused and nothing is written.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
alsoNoother domain paths this belongs to, comma-separated: the subjects that cut across the tree `domain` sits in, such as the end-to-end flow a routine is one step of. Every read scoped to one of them returns it. A path `domain` already sits under is dropped as redundant. At most 200 characters each.
tagsNocomma-separated keywords and synonyms. Retrieval is BM25 over content, tags and domain paths, and tags weigh second only to the body, so they make a memory findable by words its own text never uses: the identifier, the error string, the plain phrasing someone will type. A memory with none is reachable only by quoting itself. At most 1000 characters.
titleYesone line naming what this memory is about, in the words someone would look for it by. A list shows it instead of the opening of the body, and it outweighs every other field in search, so a title that repeats the type ("note about the parser") names nothing. At most 120 characters; a name that needs more is summarizing the body.
domainNothe subject this belongs to, as a path from the outermost scope in ('acme/x100/p200'). File it as deep as the fact is specific -- a note about one routine goes on the routine, and still comes back when someone asks about the module or the product above it. At most 200 characters.
insteadYeswhat to do, concrete enough to act on.
patternYesthe temptation, as the next agent will meet it: the move that looks right at the time. At most 800 characters.
sessionNogroups what one conversation writes. Leave it empty to use this server process's own stamp.
why_wrongYesthe mechanism that makes it fail, specific enough to recognise the next time.
source_refNowhat the fact came FROM -- a path, a URL, a table name -- so a later pass can check the claim against the thing itself instead of inferring what to check from the wording. At most 500 characters.
review_afterNowhen this stops being safe to trust unchecked, as a date ('2026-11-01') or a span from today ('90d'). pulse() counts what is overdue in a scope as `scope.stale` and optimize_scan lists it. Leave it empty for anything that does not go stale -- most facts do not, and a date nobody meant is worse than none.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed21 schema fields changedv0.16.1
    • addedInput schema / properties / also / description
      Added value: +"other domain paths this belongs to, comma-separated: the subjects that cut across the tree `domain` sits in, such as the end-to-end flow a routine is one step of. Every read scoped to one of them returns it. A path `domain` already sits under is dropped as redundant. At most 200 characters each."
    • removedInput schema / properties / also / title
      Removed value: -"Also"
    • addedInput schema / properties / domain / description
      Added value: +"the subject this belongs to, as a path from the outermost scope in ('acme/x100/p200'). File it as deep as the fact is specific -- a note about one routine goes on the routine, and still comes back when someone asks about the module or the product above it. At most 200 characters."
    • removedInput schema / properties / domain / title
      Removed value: -"Domain"
    • addedInput schema / properties / instead / description
      Added value: +"what to do, concrete enough to act on."
    • removedInput schema / properties / instead / title
      Removed value: -"Instead"
    • addedInput schema / properties / pattern / description
      Added value: +"the temptation, as the next agent will meet it: the move that looks right at the time. At most 800 characters."
    • removedInput schema / properties / pattern / title
      Removed value: -"Pattern"
    • addedInput schema / properties / review_after / description
      Added value: +"when this stops being safe to trust unchecked, as a date ('2026-11-01') or a span from today ('90d'). pulse() counts what is overdue in a scope as `scope.stale` and optimize_scan lists it. Leave it empty for anything that does not go stale -- most facts do not, and a date nobody meant is worse than none."
    • removedInput schema / properties / review_after / title
      Removed value: -"Review After"
    • addedInput schema / properties / session / description
      Added value: +"groups what one conversation writes. Leave it empty to use this server process's own stamp."
    • removedInput schema / properties / session / title
      Removed value: -"Session"
    • addedInput schema / properties / source_ref / description
      Added value: +"what the fact came FROM -- a path, a URL, a table name -- so a later pass can check the claim against the thing itself instead of inferring what to check from the wording. At most 500 characters."
    • removedInput schema / properties / source_ref / title
      Removed value: -"Source Ref"
    • addedInput schema / properties / tags / description
      Added value: +"comma-separated keywords and synonyms. Retrieval is BM25 over content, tags and domain paths, and tags weigh second only to the body, so they make a memory findable by words its own text never uses: the identifier, the error string, the plain phrasing someone will type. A memory with none is reachable only by quoting itself. At most 1000 characters."
    • removedInput schema / properties / tags / title
      Removed value: -"Tags"
    • addedInput schema / properties / title / description
      Added value: +"one line naming what this memory is about, in the words someone would look for it by. A list shows it instead of the opening of the body, and it outweighs every other field in search, so a title that repeats the type (\"note about the parser\") names nothing. At most 120 characters; a name that needs more is summarizing the body."
    • removedInput schema / properties / title / title
      Removed value: -"Title"
    • addedInput schema / properties / why_wrong / description
      Added value: +"the mechanism that makes it fail, specific enough to recognise the next time."
    • removedInput schema / properties / why_wrong / title
      Removed value: -"Why Wrong"
    • removedInput schema / title
      Removed value: -"anti_patternArguments"
  2. Changed6 schema fields changedv0.1.1
    • addedInput schema / properties / also
      Added value: +{
      +  "default": "",
      +  "title": "Also",
      +  "type": "string"
      +}
    • addedInput schema / properties / review_after
      Added value: +{
      +  "default": "",
      +  "title": "Review After",
      +  "type": "string"
      +}
    • addedInput schema / properties / source_ref
      Added value: +{
      +  "default": "",
      +  "title": "Source Ref",
      +  "type": "string"
      +}
    • addedInput schema / properties / tags
      Added value: +{
      +  "default": "",
      +  "title": "Tags",
      +  "type": "string"
      +}
    • addedInput schema / properties / title
      Added value: +{
      +  "title": "Title",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "pattern",
      -  "why_wrong",
      -  "instead"
      -]New value: +[
      +  "title",
      +  "pattern",
      +  "why_wrong",
      +  "instead"
      +]
  3. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare this is a non-read-only, non-idempotent, non-destructive write. The description goes beyond them by disclosing write semantics an agent could not infer: a field over its ceiling is refused and nothing is written, and a near-duplicate in the store returns `similar` with a `similar_hint` to correct/drop/link. This is meaningful behavioral context beyond the annotation set.

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?

Purpose and the primary sibling distinction are front-loaded in the first two sentences, followed by storage/read-back, sequencing, and return behavior. It is dense and every paragraph carries information, though the prose is leisurely enough that a point or two could be tightened.

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?

With no output schema, 10 parameters and a mutating operation, the description carries the needed load: it states the return shape (uid, project, similar), the atomic refusal behavior, and the read-back labels. Combined with 100% schema coverage, an agent has enough to call and interpret it; only return-field detail is left implicit.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and the property descriptions are themselves rich, so the schema does the heavy lifting (baseline 3). The description adds marginal value by mapping stored fields to their read-back labels (TEMPTATION / WHY WRONG / INSTEAD) and naming the type='anti_pattern' discriminator, which clarifies how the required fields behave downstream.

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 ('Record a pitfall: a move that looks right, why it fails, and what to do instead') and explicitly disambiguates from siblings note() and reasoning() by describing what each captures. An agent can tell this apart from the other memory-writing tools without opening a 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 the trigger condition ('For a mistake worth not repeating') and contrasts it with the alternatives: a plain fact belongs in note(), a settled analysis in reasoning(). It also supplies operational guidance — one pitfall per memory, link a second temptation with link_memories() — which is explicit when-to-use and how-to-sequence advice.

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