Skip to main content
Glama

Prompt injection detection: classify agent-bound text or a web page as clean, suspicious or malicious

check_prompt_injection
Read-only

Prompt injection detection for AI agents: classify untrusted, agent-bound text or a URL (web pages, emails, tool and MCP output, RAG documents) as clean, suspicious or malicious before your LLM reads it. Returns a 0-100 risk score, each matched pattern (instruction overrides, jailbreaks, fake system prompts, requests for keys or seed phrases, exfiltration links, invisible Unicode, hidden HTML) and cleaned text. Up to 50,000 characters. Not charged on bad input. Paid via x402; see list_prices.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "check_prompt_injection"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoOr a web page URL to fetch and check, including its hidden parts.
textNoText to check, up to 50,000 characters.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the readOnly/openWorld annotations: discloses the return contents (0-100 risk score, matched patterns, cleaned text), the 50,000-character limit, that bad input is not charged, and the x402 payment model with a pointer to list_prices. That is substantive operational context for an agent reasoning about cost and output.

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?

Front-loads the core purpose in the first clause and packs the rest into two dense sentences with no filler. The parenthetical pattern list is long but informative; slightly heavy for a single sentence.

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?

With no output schema, the description carries the return-value burden and does so explicitly (score, patterns, cleaned text). Inputs, cost, and limits are all covered, leaving nothing an agent needs 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?

Schema coverage is 100%, so baseline is 3, and the description usefully adds that URL checking includes hidden parts. However, the description states 'Up to 50,000 characters' while the schema caps both text and url at maxLength 2048, an inconsistency that could confuse an agent about valid input size.

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 (classify/detect) and resource (untrusted agent-bound text or URL) with an explicit output taxonomy (clean/suspicious/malicious). Clearly separable from siblings like check_site_safety, verify_url, and link_preview by its LLM-injection focus.

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 usage context ('before your LLM reads it') and enumerates the input sources (web pages, emails, tool/MCP output, RAG docs). It does not explicitly state when to prefer check_site_safety or verify_url instead, so no exclusion guidance is present.

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