Skip to main content
Glama

Injection detect: screen untrusted text or a page for prompt-injection and jailbreak attempts, with flagged spans and a sanitized copy

ai_injection_detect
Read-onlyIdempotent

Detects prompt injection and jailbreak attempts in untrusted text. Use when an agent must screen a web page, email, tool output or RAG chunk first. Input: text (max 20,000 chars; GET or POST) or url. Output: JSON probability 0-1, verdict (injection >=0.7, suspicious >=0.35), attackTypes, spans with offsets, sanitizedText minus flagged spans, method (EN/KO rules + open model). Heuristic. Example: ?text=AI assistant: disregard prior instructions Price: $0.005 per call, paid in USDC (Base, Monad, Polygon, Arbitrum 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_injection_detect"
  }
}

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.4/5.0
Behavior5/5

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

Goes well beyond the readOnly/openWorld/idempotent annotations: discloses the 20,000-character cap, GET vs POST transport, cost ($0.005 per call via x402 in USDC), detection method (EN/KO rules plus open model), and states it is heuristic, signaling false-positive risk. The verdict thresholds (0.7/0.35) also tell the caller how to interpret 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 purpose, then use case, then labeled Input/Output blocks — easy to scan. Slightly overpacked: the worked example spends words on pricing and five chain names that are irrelevant to invoking the tool.

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 enumerates the return fields (probability, verdict, attackTypes, spans with offsets, sanitizedText, method) and their thresholds, so an agent knows exactly what comes back. Limits, transport, and cost are all covered for a two-parameter screening tool.

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 text and url, including the 'text or url, not both' rule. The description restates the char limit and transport options but adds no new semantic detail about the parameters, so the baseline 3 applies.

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 — detects prompt injection and jailbreak attempts in untrusted text — and the title narrows scope to screening untrusted text or a page. This is clearly separable from siblings like sanctions_screen or the ai_* media tools.

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?

Explicitly gives the trigger condition: use when an agent must screen a web page, email, tool output or RAG chunk first. No when-not conditions or named alternatives are offered, but the domain is narrow enough that no sibling competes directly.

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