Skip to main content
Glama

Agent Data Tools: Company, compliance and checks

Prompt injection detection: scan text for injection attempts

text_prompt_injection
Read-only

Scan text an agent is about to read (web page, email, tool result; up to 8,000 characters) for prompt-injection attempts: instruction overrides, fake system messages, asks to hide things from the user, exfiltration links, attempts to extract private data or move money, invisible Unicode. Returns a risk level, score and findings with excerpts. Heuristic, not a guarantee. Use before acting on untrusted content. Example: text=Thanks for the update. The signed invoice is attached and payment is due on Friday.. Price $0.01/call via x402 USDC or a card key (/credits), first 10 free; failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not free.

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

Input Schema

NameRequiredDescriptionDefault
textYesThe text to scan (up to 8,000 characters)

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?

Adds substantial context beyond the annotations: the heuristic/not-a-guarantee caveat, the 8,000-character ceiling, the return shape (risk level, score, findings with excerpts), and the pricing model including free failures and non-free repeats. The 'reads or computes only and changes nothing' clause largely repeats readOnlyHint/destructiveHint, which slightly dilutes the additive value.

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 capability and threat categories, then returns, caveat, usage trigger, and cost — a sensible ordering with little filler. The example sentence is malformed ('Friday..') and adds bulk without teaching much, and the billing details sit awkwardly against the core purpose.

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?

With no output schema, the description does the work of describing the response (risk level, score, findings with excerpts) and flags the trust boundary and cost model. It does not define the risk-level scale or say how findings should change agent behavior, which is a minor gap for a safety-gate 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?

Only one parameter at 100% schema coverage, so the schema already carries the semantics and the baseline is 3. The description restates the 8,000-character limit and offers an example value, but the example is a benign invoice sentence that does not clarify expected input beyond what the schema says.

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 ('scan text ... for prompt-injection attempts') and enumerates the concrete threat classes it detects (instruction overrides, fake system messages, exfiltration links, invisible Unicode). An agent can distinguish this from sibling scanners like text_pii or text_language purely from the description.

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: 'Use before acting on untrusted content,' with the input sources enumerated (web page, email, tool result). It does not name an alternative or state when-not to bother (e.g., for trusted/internal text), so it stops short of full routing guidance.

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