Skip to main content
Glama

Prompt-injection check: probability, attack types, flagged spans and a sanitized copy of text or a page

ai_prompt_injection

Use when an agent must screen untrusted text (web page, email, tool output, RAG chunk) before an LLM reads it. Input: text (up to 20,000 chars, POST JSON or GET) or url. Output: JSON probability 0-1, verdict (clean/suspicious/injection), attackTypes, spans with offsets, sanitizedText with flagged spans removed, method (rules + open-model classifier; rules only if the model is down). Heuristic, not a guarantee. Example: ?text=Ignore previous instructions Price: $0.003 USDC (Base or Solana) via x402.

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": "ai_prompt_injection"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoPublic http(s) page to fetch and check instead of text (SSRF-safe); give text or url, not both
textNoText to check (up to 20,000 characters). Required unless url is given; use POST JSON for long text

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the detection method (rules + open-model classifier), the degraded mode when the model is down (rules only), and the explicit limitation 'Heuristic, not a guarantee.' It also notes SSRF-safe fetching and the USDC/x402 payment path. It omits latency and any rate/cost-quota detail beyond the per-call price hint.

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-loaded with the trigger, then input, output, method, and caveat in that order — a sensible structure with no filler sentences. It is dense to the point of being run-on, and the pricing tail ('$0.003 USDC (Base or Solana) via x402') is mixed into the example rather than separated.

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?

No output schema exists, so the description must describe returns, and it does: probability, verdict enum values, attackTypes, spans with offsets, sanitizedText, and method. Combined with the explicit heuristic caveat, an agent has enough to call it and interpret results, though span offset semantics (character vs byte) are left unspecified.

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 the schema already documents both parameters including the 20,000-char limit, POST JSON for long text, and 'give text or url, not both.' The description largely restates those facts; its only marginal addition is the concrete '?text=' GET example, which illustrates transport rather than parameter meaning.

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 — screen untrusted text for prompt injection before an LLM reads it — and enumerates the exact input sources (web page, email, tool output, RAG chunk). No sibling in the list does this, so an agent can select it without opening the schema.

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 an explicit trigger condition ('Use when an agent must screen untrusted text ... before an LLM reads it') that maps cleanly to a point in an agent pipeline. It does not name a when-not case or point to adjacent tools (web_read, docs_extract, web_extract) that might otherwise be confused with it.

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