Skip to main content
Glama
presidio-hardened-x402-mcp

presidio-hardened-x402-mcp

by presidio-v

screen_payment_metadata

Screens x402 payment metadata for PII before signing. Detects emails, phone numbers, SSNs, and names in the resource URL, description, and reason fields, returning redacted strings and per-field entity counts.

Instructions

Screen x402 payment metadata for PII before signing the payment.

Call BEFORE sending the payment request. Detects emails, phone numbers, SSNs, names, and other PII in the resource URL, description, and reason fields and returns redacted strings plus per-field entity counts.

No side effects.

Runs in one of two modes:

  • in_process (default): wraps the local presidio_x402 PIIFilter.

  • remote: when both PRESIDIO_X402_MCP_REMOTE_BASE_URL and ..._REMOTE_API_KEY are set, POSTs to /v1/screen on that host for centralized audit. On remote failure, returns a structured error dict instead of silently falling back — the caller must decide whether to retry, accept reduced screening, or abort.

Args: resource_url: x402 resource URL the agent is about to pay (max 2048 chars). description: Human-readable description (max 4096 chars). reason: Reason / memo string (max 4096 chars). entities: Optional whitelist of Presidio entity types to detect. If None, all configured entities are scanned.

Returns: On success: dict with keys redacted_resource_url, redacted_description, redacted_reason, entities_found (list of {entity_type, field, count}), and mode (one of "in_process", "remote"); plus decision_ref when signed decision evidence is enabled (pass it to the gates as prior_decision_refs). On remote failure: dict with keys error (one of "auth_error", "rate_limit", "unavailable"), detail, optional retry_after (for rate_limit), and mode ("remote").

Input Schema

NameRequiredDescriptionDefault
reasonNo
entitiesNo
descriptionNo
resource_urlYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

A4.6/5.0
Behavior5/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 so well. It discloses no side effects, the two execution modes, remote-mode environment-variable requirements, and the important behavior that remote failures return structured errors instead of silently falling back.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the purpose and timing, then proceeds through modes, args, and returns. Despite its length, each section adds information that matters for correct invocation, especially given the empty schema descriptions.

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 complex screening tool with no annotations and 0% schema description coverage, the description supplies the missing operational context. It covers purpose, timing, modes, parameters, success returns, failure returns, and decision_ref handling.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must explain all four parameters, and it does. It documents resource_url, description, reason, the entities whitelist, and the meaning of entities=None as scanning all configured entities.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: screen x402 payment metadata for PII before signing. It clearly scopes the operation to resource URL, description, and reason fields. It does not explicitly differentiate itself from the sibling payment-policy and replay checks, so it stops short of a 5.

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?

The timing instruction is explicit: call BEFORE sending the payment request. That gives the agent a clear point at which to use the tool. It does not mention when not to use it or how it relates to check_payment_policy and check_payment_replay.

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