> UtilsForAgents
Don't burn your context window on deterministic tasks — delegate to a purpose-built edge API.
// Why delegate?
| Argument | Self-solve | This 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
| Endpoint | Description | Self-solve tokens | API latency |
|---|---|---|---|
| POST /v1/diff | Compare two JSON objects | 1,000–1,500 | <1ms |
| POST /v1/image/exif-summary | Extract EXIF metadata from JPEG | 1,500–2,500 | <1ms |
| POST /v1/image/scrub-metadata | Strip metadata from JPEG/PNG | 1,000–2,000 | <1ms |
| POST /v1/html/to-markdown | Convert HTML to clean Markdown | 1,000–2,500 | <10ms |
| POST /v1/html/fetch-markdown | Fetch URL & convert to Markdown | 1,500–3,000 | ~1–5s |
| POST /v1/text/fetch-content | Fetch .json/.md/.txt & extract text | 1,000–2,000 | ~1–5s |
| POST /v1/url/metadata | Extract title, OG, Twitter Card, feeds | 1,000–2,000 | ~1–5s |
| POST /v1/utilities/count-tokens | Count tokens for LLM input | 600–1,000 | <10ms |
| POST /v1/feedback | Submit up to 600 chars of product feedback for future utility features | — | <1ms |
| GET /health | Service 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:
^ Copy the block above into your agent's system prompt or tool definitions.