# LLM Text Toolbox

> A dependency-free Python toolkit for JSON repair, text chunking, token estimation, and near-duplicate detection.

LLM Text Toolbox is a free AI agent skill on Agensi by dodon, in LLM Ops. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [dodon](https://www.agensi.io/creators/dodon)
- Category: [LLM Ops](https://www.agensi.io/skills/llm-ops)
- Version: 1.0
- Last updated: 2026-11-25
- Security: scan passed (2026-11-25); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/llm-text-toolbox
- Tags: llm-ops, ai-agents, python, mcp-server, json-parsing, rag

## 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

1. **Integration** adds the library to your Python project or connects the MCP server to your agent client.
2. **Tool Registry** accesses functions like `repair_json` or `chunk_text` via a central registry.
3. **Execution** runs logic locally using the Python standard library with no third-party dependencies.
4. **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.

## Requires

- Python
- Git

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the LLM Text Toolbox skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does 'JSON recovery' differ from just asking the LLM to fix the JSON?

Unlike prompting a model to fix its own errors, this toolkit uses deterministic Python logic to repair structural issues like trailing commas or markdown fences instantly and without additional API costs or latency.

### Which AI agents or development environments are supported?

The toolkit is built for Python 3.10+ and includes an MCP (Model Context Protocol) server, making it natively compatible with agent environments like Claude Code, Cursor, and Windsurf.

### Do I need to install external libraries like Tiktoken or NLTK to use these tools?

No, the toolkit is completely dependency-free and uses the Python standard library, meaning it won't conflict with your existing packages or require heavy installations like PyTorch or HuggingFace.

### How accurate is the local cost estimation compared to official model tokenizers?

The token estimation tool uses a character-based heuristic that is roughly 80-90% accurate for English text, providing a fast, local way to budget costs without an internet connection or specific model tokens.

### What exactly is included in the purchase of the LLM Text Toolbox?

You receive the full Python source code for the toolkit, the MCP server integration for agent use, and documentation for both the Tool Registry and standalone library implementation.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
