Skip to main content
Glama

Check text for prompt injection

check_prompt_injection
Read-only

Check untrusted text before your agent reads it (web pages, emails, social posts, tool results, documents): finds prompt-injection attempts such as instruction overrides, fake system or tool-call markers, hidden text, data-leak links and demands to move funds. Returns a verdict, a 0-1 risk score, each finding with its location, and a cleaned copy with hidden characters and flagged lines removed. With mode=memory it also guards long-term memory writes against planted history, standing orders and 'trusted' addresses. US$0.003 per call; 3 free calls a day.

Input Schema

NameRequiredDescriptionDefault
modeNo'memory' when the text is about to be saved to long-term memory.
textYesThe untrusted text (up to 20,000 characters).
contextNoWhere it came from, e.g. 'web page', 'tweet'.

Output Schema

NameRequiredDescriptionDefault
paidNo
riskNo
trialNo
layersNo
messageNo
verdictNo
findingsNo
cleaned_textNo
pay_per_callNo
hidden_characters_removedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "cleaned_text": {},
      +    "findings": {},
      +    "hidden_characters_removed": {},
      +    "layers": {},
      +    "message": {},
      +    "paid": {},
      +    "pay_per_call": {},
      +    "risk": {},
      +    "trial": {},
      +    "verdict": {}
      +  },
      +  "type": "object"
      +}
  2. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations cover safety (readOnlyHint, destructiveHint=false), but the description adds the return contract (verdict, 0-1 risk score, located findings, cleaned copy with hidden characters removed), the memory-mode behavior, per-call price and the 3-free-calls-a-day rate limit — none of which the annotations convey.

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 'before your agent reads it' directive are front-loaded, and the parenthetical source list is genuinely useful. The first sentence is a long multi-clause run-on carrying the detection examples, which slightly taxes parsing but every clause adds information.

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?

Complete for a 3-parameter, single-required-arg tool: usage timing, mode semantics, detection scope, return shape, cost and rate limits are all present, and the output schema is not leaned on to explain results.

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 already 100%, so the baseline is 3; the description goes beyond it by explaining what 'memory' mode actually guards against (planted history, standing orders, 'trusted' addresses). The 'context' and 'text' params get no added detail, but the schema already documents the 20,000-character limit.

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 ('Check untrusted text ... for prompt-injection attempts') and enumerates the concrete threat classes it detects (instruction overrides, fake tool-call markers, hidden text, data-leak links, fund-move demands). No sibling tool (read_pages, web_search, quick_ai) overlaps with this security-scanning purpose, so differentiation is achieved by the described scope itself.

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 clear timing and context: run it 'before your agent reads it,' with concrete input sources (web pages, emails, social posts, tool results, documents), and a second mode for long-term memory writes. It never states when not to use it or names an alternative, which keeps it short of a 5.

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