# process_json

Prettify, validate, or minify a JSON string. Use this for debugging, formatting API responses, cleaning up configuration files, or verifying that a string is valid JSON. Parameters: json_string — The JSON string to process (required). Pass the raw JSON text. mode — Operation: "prettify" (indent + sort keys), "validate" (check syntax only), or "minify" (compact, no whitespace) (default: "prettify").

Agent View of the PolicyLayer registry record for `process_json`. HTML page: https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/process-json

## Facts

- Tool: `process_json`
- Server: X402 Middleware (`@gadgethumans/x402`) — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware.md
- Install: `npx -y @gadgethumans/x402`
- Homepage: https://github.com/scotia1973-bot/gadgethumans-x402
- Risk category: Read (Low risk)
- Registry record: grade F, identity unverified
- Server auth posture: open
- Server rate-limited: no
- Parameters: 2 (1 required)
- Recommended policy verdict: Allowed

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `mode` | string | no |  |
| `json_string` | string | yes |  |

Parameters from the server's own tool schema.

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "process_json",
    "arguments": {
      "json_string": "<json_string>"
    }
  }
}
```

## Why process_json is rated Low

This tool only inspects and reformats JSON strings without altering external state or data stores. It produces output based on input but makes no writes, executions, deletions, or financial transactions. The formatting and validation are purely informational operations, making it a Read-category tool with low risk.

From the tool's own definition: "Tool performs three operations on JSON strings: prettify (indent + sort keys), validate (check syntax only), or minify (compact, no whitespace)."

## Use case

AI agents call process_json to retrieve information from X402 Middleware without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.

## Recommended policy (PolicyLayer)

Verdict: **Allowed**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches X402 Middleware:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "process_json": {}
  }
}
```

## Other tools on X402 Middleware (57)

- `agent_memory` — Destructive — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/agent-memory.md
- `wallet_buy` — Financial — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/wallet-buy.md
- `x402_payment_request` — Financial — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/x402-payment-request.md
- `x402_pricing` — Financial — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/x402-pricing.md
- `x402_verify_payment` — Financial — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/x402-verify-payment.md
- `analyze_readability` — Read — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/analyze-readability.md
- `analyze_url` — Read — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/analyze-url.md
- `bmr_calc` — Read — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/bmr-calc.md
- `calculate_bmi` — Read — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/calculate-bmi.md
- `calculate_date` — Read — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/calculate-date.md
- `check_ssl_certificate` — Read — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/check-ssl-certificate.md
- `classify` — Read — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/classify.md
- `compare_items` — Read — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/compare-items.md
- `convert_currency` — Read — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/convert-currency.md
- `convert_timestamp` — Read — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/convert-timestamp.md
- `convert_timezone` — Read — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/convert-timezone.md
- `decode_jwt` — Read — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/decode-jwt.md
- `detect_language` — Read — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/detect-language.md
- `dns_lookup` — Read — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/dns-lookup.md
- `extract_contacts` — Read — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/extract-contacts.md
- `generate_seo_metadata` — Read — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/generate-seo-metadata.md
- `generate_uuid` — Read — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/generate-uuid.md
- `geocode` — Read — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/geocode.md
- `geolocate_ip` — Read — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/geolocate-ip.md
- `get_air_quality` — Read — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/get-air-quality.md
- `get_crypto_prices` — Read — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/get-crypto-prices.md
- `get_forecast` — Read — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/get-forecast.md
- `get_og_metadata` — Read — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/get-og-metadata.md
- `get_weather` — Read — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/get-weather.md
- `grammar` — Read — https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware/grammar.md
- …and 27 more: https://policylayer.com/tools/com-gadgethumans-swarm-x402-middleware.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=com-gadgethumans-swarm-x402-middleware · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/com-gadgethumans-swarm-x402-middleware
