Skip to main content
Glama

Prompt-injection pre-filter

injection_scan
Read-onlyIdempotent

Prompt-injection detection for untrusted text (web pages, emails, documents, tool output) before it reaches an LLM; a guardrail for agent pipelines. Flags instruction overrides, role spoofing, secret/system-prompt exfiltration, image beacons, tool-call markup, hidden Unicode, hidden HTML and base64 payloads. Returns a 0-100 risk score, risk level and matched rules. Deterministic rules, no LLM. JSON body {text}, max 32 KB. Errors: 400 missing text, 413 too large. PAID: $0.002 USDC per call on Base via x402 (MCP transport: retry with params._meta["x402/payment"]). Same tool over plain HTTP: POST /v1/text/injection-scan.

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>"
    },
    "name": "injection_scan"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Goes well past the annotations: discloses determinism ('no LLM'), the return payload (0-100 risk score, risk level, matched rules), the 32 KB cap, specific error codes (400, 413), and critically the paid x402 flow including the retry mechanism with params._meta["x402/payment"]. That payment requirement is high-value behavior an agent cannot infer from readOnlyHint/idempotentHint.

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 purpose before mechanics (payment, HTTP path), and every clause adds information. It is dense with semicolons and parenthetical payment detail, which slightly fragments readability but nothing is wasted.

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?

For a single-parameter tool with no output schema and no annotation coverage of cost/errors, the description supplies return shape, failure modes, size limit, and the payment protocol. An agent has everything needed to invoke and handle it correctly.

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 0%, so the description carries the burden, and it does specify the body shape ({text}) and the 32 KB maximum, which mirrors the maxLength constraint. It does not describe the text's expected encoding or whether truncation is acceptable, so it is not fully exhaustive.

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+resource ('Prompt-injection detection for untrusted text') and enumerates exactly which attack classes are flagged. No sibling tool overlaps, and the scope ('before it reaches an LLM') makes the boundary unambiguous.

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 frames the use case and timing: run on untrusted text (web pages, emails, documents, tool output) before it reaches an LLM, as a guardrail in agent pipelines. It does not name an alternative tool to use instead, but none of the listed siblings are substitutes, so the guidance is effectively complete without exclusions.

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