Skip to main content
Glama
x402-preflight-mcp

x402-preflight-mcp

by animus3d

prompt_injection_scan

Detects prompt-injection overrides, jailbreak framing, hidden zero-width Unicode, and credential-exfiltration patterns in untrusted text before an agent processes it.

Instructions

[x402 $0.02 USDC on Base/Solana] Deterministic detector for prompt-injection overrides, jailbreak framing, hidden Unicode zero-width chars, and credential exfiltration patterns.

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

Input Schema

NameRequiredDescriptionDefault
textYesUntrusted text or document chunk to scan
_paymentSignatureNoOptional base64-encoded x402 v2 payment-signature header (overrides X402_PAYMENT_SIGNATURE env var).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/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 behavioral burden and does disclose two non-obvious traits: the tool is deterministic (not an LLM judgment call) and it is a paid x402 endpoint costing $0.02 USDC on Base/Solana. It does not describe the return shape (boolean, matched spans, score) or behavior on clean input, which is a real but secondary gap.

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?

A single dense sentence with zero filler that front-loads the cost/payment banner before the capability. The bracket structure makes the pricing easy to extract, though leading with the price rather than the capability slightly delays what the tool actually does.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple (one required string plus an optional payment override) and the description covers purpose, cost, and detection scope. However, no output schema exists and the description never indicates what a scan returns, which for a detector is the main thing an agent needs to know to act on results.

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 both parameters (text and _paymentSignature) are already documented in structured form. The description adds no syntax, size limits, or encoding guidance for the text parameter beyond what the schema states, so the baseline of 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?

"Deterministic detector for prompt-injection overrides, jailbreak framing, hidden Unicode zero-width chars, and credential exfiltration patterns" names a specific operation and enumerates exactly what class of content it inspects. No sibling tool in the list overlaps with prompt-injection scanning, so the agent can distinguish it from the security-linting tools (jwt_oidc_security_linter, solidity_quickscan) 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 Guidelines3/5

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

The description implies usage through the phrase "Untrusted text or document chunk" in the schema, but never states when to call this versus another tool, nor any exclusions or prerequisites. An agent can infer it should be used before consuming untrusted content, but that inference is not written down.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.