LLM Text Toolbox
by dodon
A dependency-free Python toolkit for JSON repair, text chunking, token estimation, and near-duplicate detection.
Free
LLM Text Toolbox
Example session with this skill installed
I have some messy JSON output from a model inside markdown fences with trailing commas. Can you extract and fix it, then estimate the token count?
- Read your context and instructions
- Compiled the llm text toolbox
I have processed the text to extract the JSON object and estimated the token usage for the original input.
Text Processing Results
JSON Repair Output
| Field | Value |
|---|---|
| Status | Repaired |
| Repairs Applied | removed markdown code fence, removed trailing commas, converted single-quotes |
| Parsed Data | {"status": "success", "items": [1, 2, 3], "metadata": {"version": 1.0}} |
Token Estimation
| Metric | Estimate |
|---|---|
| Character Count | 142 |
| Word Count | 24 |
| Estimated Tokens | 34 |
| Estimated Cost ($0.01/1k) | $0.00034 |
# The repaired JSON is ready for programmatic use:
repaired_data = {
"status": "success",
"items": [1, 2, 3],
"metadata": {"version": 1.0}
}
Next steps
- Use
chunk_textif you need to split this data for a long-context prompt. - Pass the repaired JSON directly into your application logic.
- Configure
price_per_1k_tokensin your next call for more accurate budgeting.
Connects securely to your tools. The creator never sees your data.
About this skill
LLM outputs are notoriously messy, and preparing large datasets for context windows is brittle. This skill provides a dependency-free Python toolkit to clean model output, chunk documents, and estimate costs without external tokenizers.
What it does
- JSON recovery extracts and repairs objects from prose, fixing trailing commas, single quotes, and markdown fences.
- Smart chunking splits long text for RAG or map-reduce while preserving sentence and paragraph boundaries.
- Cost estimation calculates token counts and monetary costs locally using word and character heuristics.
- Near-duplicate detection identifies similar texts using Jaccard similarity to prune redundant data.
- Extractive summarization generates summaries using sentence frequency scoring without making a model call.
How it works
- Integration adds the library to your Python project or connects the MCP server to your agent client.
- Tool Registry accesses functions like
repair_jsonorchunk_textvia a central registry. - Execution runs logic locally using the Python standard library with no third-party dependencies.
- Validation returns structured results including repair logs, chunk counts, or similarity clusters.
Frameworks & tools
This toolkit is built for Python 3.10+ using only the standard library. It includes an MCP server for direct use with Claude Code, Cursor, and other MCP-compatible agent environments.
Why this beats prompting it yourself
Prompting an LLM to "fix this JSON" is slow, expensive, and often introduces new errors. These tools provide deterministic, zero-latency alternatives for structural cleanup and data preparation tasks that do not require generative intelligence.
Use cases
- Clean up malformed JSON responses from smaller or quantized models.
- Prepare large text files for vector embeddings with overlapping chunks.
- Budget API costs before sending massive batches to expensive providers.
- Deduplicate scraped web content or user-generated logs before processing.
Known limitations
Token estimation is a heuristic with 10-20% accuracy for English prose and is less accurate for code or non-English languages. Repair tools will not guess or hallucinate missing data.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 10 days ago
- Free with an Agensi account
- Software
Python
Git
Permissions
What's inside
Creator
dodon
2 skills on Agensi
Frequently Asked Questions
New in LLM Ops
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.