Text analysis
Full text analysis - word/sentence stats, keyword extraction, and token count in one pass.
3 tools run server-side in one request. You pay once, settle once, and get a single response - no orchestration, no per-step payments, and a partial-success envelope if any step fails. USDC over x402 on any supported chain.
When to use this pack
An agent evaluating text content needs the complete picture: how long is it (words, sentences, paragraphs), what are the key topics (keyword extraction), and how many LLM tokens would it consume? Useful for content pipelines, RAG prep, and prompt budgeting.
Tools in this pack
All 3 run inside the single $0.050 call above. Each is also callable on its own if you only need one part.
- Text statistics POST /api/text-stats Characters, words, sentences, paragraphs, average word length, reading time, and an LLM token estimate for any text.
- Keyword extraction POST /api/keywords Top keywords and two-word phrases by frequency (stopwords removed). Cheap, deterministic signal for routing, tagging, and dedup.
- Token count POST /api/token-count Count exact LLM tokens for a string using the real OpenAI BPE (o200k_base for gpt-4o/o-series, cl100k_base for gpt-4/gpt-3.5). Deterministic, offline - budget context windows without calling a model.
Workflow
- Call text-stats to get word count, sentence count, paragraph count, and reading time.
- Call keywords to extract the top terms and their frequency.
- Call token-count to estimate the LLM token consumption (useful for prompt budgeting).
Call it directly
Any x402 client pays the 402 and gets the whole workflow back in one response:
npx agent402-client call text-analyze {"text":"The x402 protocol enables pay-per-call API payments using USDC stablecoins on Base and other chains."}
Run it in Claude
claude mcp add agent402 -s user -- npx -y agent402-mcp@latest
Then paste this prompt into Claude:
Analyze this text using Agent402's text-analyze skill pack: 'The x402 protocol enables pay-per-call API payments using USDC stablecoins on Base and other chains.' (1) Text stats, (2) keywords, (3) token count. Report the full analysis.