Skip to main content
Glama

Habits prompt-injection guard

Teach your guard

teach_guard
Idempotent

Label one prompt for your own guard so it stops repeating a mistake (a false alarm on a normal request, or a missed injection). Needs an API key (get_free_key). About 50 of your own labels cut false alarms from 15% to 4% in our benchmark.

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": {
      "text": "<text>",
      "injection": "<injection>"
    },
    "name": "teach_guard"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesthe prompt
injectionYestrue if it IS an injection/jailbreak, false if it is a normal request

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior3/5

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

Annotations declare readOnlyHint=false and idempotentHint=true, so the agent already knows this mutates state and is safe to repeat. The description adds genuine value by disclosing the auth requirement (get_free_key) and the scoping to 'your own guard,' but it never says whether the label takes effect immediately, whether more labels can be batched, or what comes back after labeling.

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 short sentences, front-loaded with the action and its payoff, then the prerequisite, then the benefit statistic. The benchmark figure supports adoption rather than the mechanics of the call, but it is brief enough not to crowd out the operative content.

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?

For a two-parameter, non-read-only tool with no output schema, the description covers purpose, trigger condition, auth prerequisite, and expected effect. The remaining gap is post-call behavior – whether labeling is immediate and whether there is any confirmation or cost – which matters somewhat for a mutating tool.

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 coverage is 100%, so both parameters are already documented, making 3 the baseline. The description earns above that by translating the two error modes it names – false alarm and missed injection – onto the meaning of the boolean 'injection' field, giving the agent a semantic mapping rather than just a type.

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 ('Label one prompt for your own guard') and frames the outcome ('stops repeating a mistake'), which is concrete enough to separate it from check_prompt. It does not explicitly name check_prompt as the runtime-check counterpart, so sibling differentiation is implied rather than stated.

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 clear trigger condition – the guard is making a recurring error, either a false alarm on a normal request or a missed injection – and names get_free_key as the prerequisite for the API key. It stops short of an explicit exclusion such as 'do not use this for one-off verdicts; use check_prompt instead.'

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