Skip to main content
Glama

Scan content for prompt injection

stack_scan

Scan text or a JSON object (an email, document, web page, API response or similar) for prompt-injection markers. Detection uses a regex pattern catalog plus encoding-aware normalization (base64, URL, hex, leetspeak, unicode homoglyphs, zero-width characters, ROT13, reversed text), plus an optional classifier layer that can also run. STACK keeps the verdict and snippets, never the scanned content: a suspicious or critical verdict records a security event with the matched excerpt (up to 80 characters), a short reasoning note and the source label, and every scan writes an audit row that holds at most the matched pattern id and field path, never the scanned text. Returns verdict ("clean", "suspicious" or "critical"), match details, scan_id and duration_ms. Each scan is metered.

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": {
      "content": "<content>"
    },
    "name": "stack_scan"
  }
}

Input Schema

NameRequiredDescriptionDefault
sourceNoOptional source identifier (URL / sender / filename). Truncated to 256 chars in security event metadata.
contentYesThe content to scan. Strings scanned directly; objects walked one level deep.
contextNoOptional context tag, recorded in security event metadata for filtering by retrieval source.
passport_tokenNoOptional passport JWT for attribution to a specific agent context.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Goes well beyond the annotations (readOnlyHint=false, destructiveHint=false, openWorldHint=false) by disclosing the privacy model: the scanned content is never retained, only a matched excerpt of up to 80 characters, a reasoning note, a source label, and an audit row with at most a pattern id and field path. It also discloses metering and the exact verdict vocabulary. Not a 5 only because the write side effects (audit row plus security event) are described in prose rather than tied back to the non-read-only annotation, and no failure or error behavior is mentioned.

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, then detection method, then data-handling guarantees and return shape — a sensible ordering with no filler sentences. It is dense as a single paragraph, and the long parenthetical encoding list slightly slows scanning, but every clause carries information.

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 supplies the return fields (verdict, match details, scan_id, duration_ms), the verdict vocabulary, retention behavior, and the metering caveat. For a four-parameter scan tool that writes audit records, that is sufficient for an agent to call it correctly and predict the outcome.

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 description coverage is 100%, so all four parameters — including the context enum and passport_token — are already documented in the schema. The description restates that a source label is recorded and that strings are scanned directly, both of which the schema already conveys, so it adds little parameter-level meaning beyond the structured data.

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 or a JSON object for prompt-injection markers — and enumerates the content types it applies to (email, document, web page, API response). It also names the detection mechanism (regex catalog plus normalization layers, optional classifier), which separates it from adjacent tools like stack_scan_usage or the flagged-content settings tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied rather than stated: the content-type list suggests scanning untrusted inbound material, and 'Each scan is metered' hints at a cost consideration. There is no explicit when-to-use or when-not-to-use rule, and no pointer to an alternative (e.g. stack_scan_usage) for inspecting scan quotas or history before calling.

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.