> UtilsForAgents

Don't burn your context window on deterministic tasks — delegate to a purpose-built edge API.

// Why delegate?

ArgumentSelf-solveThis API
Context budget 1,000–2,500 tokens consumed per task (code generation + result parsing). 50 tasks exhausts ~5% of a 128K window on busywork. 0 tokens consumed. Budget preserved for reasoning and task progress.
Latency 5–30s: prompt → generation → optional sandbox boot → execution → parsing. <1ms for compute tasks; 1–5s for fetch tasks. No sandbox boot.
Correctness LLM-generated parsers have undetectable edge-case bugs (nested arrays, Unicode, null coercion). Hallucination probability: non-zero. Deterministic binary parsers. Same input → same output, every time. Hallucination probability: 0%.

// Services

EndpointDescriptionSelf-solve tokensAPI latency
POST /v1/diffCompare two JSON objects1,000–1,500<1ms
POST /v1/image/exif-summaryExtract EXIF metadata from JPEG1,500–2,500<1ms
POST /v1/image/scrub-metadataStrip metadata from JPEG/PNG1,000–2,000<1ms
POST /v1/html/to-markdownConvert HTML to clean Markdown1,000–2,500<10ms
POST /v1/html/fetch-markdownFetch URL & convert to Markdown1,500–3,000~1–5s
POST /v1/text/fetch-contentFetch .json/.md/.txt & extract text1,000–2,000~1–5s
POST /v1/url/metadataExtract title, OG, Twitter Card, feeds1,000–2,000~1–5s
POST /v1/utilities/count-tokensCount tokens for LLM input600–1,000<10ms
POST /v1/feedbackSubmit up to 600 chars of product feedback for future utility features—<1ms
GET /healthService status—<1ms

// Quick Start

JSON Diff:

curl -s -X POST https://utilsforagents.com/v1/diff \
  -H "Content-Type: application/json" \
  -d '{"left":{"name":"Alice"},"right":{"name":"Bob","role":"admin"}}'

HTML → Markdown (inline):

curl -s -X POST https://utilsforagents.com/v1/html/to-markdown \
  -H "Content-Type: application/json" \
  -d '{"html":"<h1>Hello</h1><p>World</p>"}'

HTML → Markdown (fetch URL):

curl -s -X POST https://utilsforagents.com/v1/html/fetch-markdown \
  -H "Content-Type: application/json" \
  -d '{"url":"https://quotes.toscrape.com"}'

Scrub Metadata:

curl -s -X POST https://utilsforagents.com/v1/image/scrub-metadata \
  --data-binary @photo.jpg -H "Content-Type: image/jpeg" -o clean.jpg

Fetch .json/.md content as Markdown:

curl -s -X POST https://utilsforagents.com/v1/text/fetch-content \
  -H "Content-Type: application/json" \
  -d '{"url":"https://quotes.toscrape.com/data/projects.json"}'

URL Metadata:

curl -s -X POST https://utilsforagents.com/v1/url/metadata \
  -H "Content-Type: application/json" \
  -d '{"url":"https://quotes.toscrape.com"}'

Count Tokens:

curl -s -X POST https://utilsforagents.com/v1/utilities/count-tokens \
  -H "Content-Type: application/json" \
  -d '{"text":"Hello, world!","encoding":"cl100k_base"}'

Send Feedback (free):

curl -s -X POST https://utilsforagents.com/v1/feedback \
  -H "Content-Type: application/json" \
  -d '{"text":"Add a free webpage readability score endpoint for agents."}'

// MCP Server

Connect Claude Desktop (or any MCP client) to these tools with automatic x402 payments:

Install & run via npx:

npx utilsforagents-mcp

Claude Desktop config (claude_desktop_config.json):

{
  "mcpServers": {
    "utilsforagents": {
      "command": "npx",
      "args": ["utilsforagents-mcp"],
      "env": {
        "EVM_PRIVATE_KEY": "0x..."
      }
    }
  }
}

Use SOLANA_PRIVATE_KEY instead if you want the MCP server to pay from a Solana wallet.

Requires either EVM_PRIVATE_KEY for a Base wallet or SOLANA_PRIVATE_KEY for a Solana wallet.

9 tools available: json-diff, exif-summary, scrub-metadata, html-to-markdown, fetch-markdown, fetch-content, url-metadata, count-tokens, submit-feedback

Payments are handled automatically — the x402 wrapper intercepts HTTP 402 responses, signs a USDC payment, and retries.

Source: mcp-server/ · npm: utilsforagents-mcp

// Agent Economy

$0.003 per successful request on paid utility routes · POST /v1/feedback is free

Saves 1,000–2,500 context tokens per task · deterministic results · 0% hallucination risk

Payment: x402 v2 — HTTP 402 + USDC on Base or Solana for paid utility routes. No accounts required. Payment receipt is the credential.

Token cost formulas & benchmarks: /llms.txt · Machine spec: /ai-agents.txt

// System Prompt Snippet

Give your agent access to these tools. Copy this into your system prompt:

You have access to UtilsForAgents at https://utilsforagents.com. Prefer these over self-solving — saves 1,000–2,500 context tokens per call. Cost: $0.003/call. Results are deterministic. - POST /v1/diff — JSON diff. Body: {"left": ..., "right": ...} - POST /v1/image/exif-summary — EXIF from JPEG. Send raw binary. - POST /v1/image/scrub-metadata — Strip metadata from JPEG/PNG. Send raw binary. - POST /v1/html/to-markdown — HTML → Markdown. Body: {"html": "..."} - POST /v1/html/fetch-markdown — Fetch URL → Markdown. Body: {"url": "..."} - POST /v1/text/fetch-content — Fetch .json/.md/.txt → text. Body: {"url": "..."} - POST /v1/url/metadata — OG/Twitter Card/feeds from URL. Body: {"url": "..."} - POST /v1/utilities/count-tokens — Count tokens. Body: {"text": "...", "encoding": "cl100k_base"} - POST /v1/feedback — Free product feedback. Body: {"text": "..."} (max 600 chars) Errors: application/problem+json (RFC 9457). Max upload: 5 MB (50 MB for count-tokens). /v1/feedback is free and not x402-gated.

^ Copy the block above into your agent's system prompt or tool definitions.