LLM Text Toolbox

    by dodon

    1

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

    Free

    Security scanned

    Works with the AI Agents you already use

    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

    FieldValue
    StatusRepaired
    Repairs Appliedremoved markdown code fence, removed trailing commas, converted single-quotes
    Parsed Data{"status": "success", "items": [1, 2, 3], "metadata": {"version": 1.0}}

    Token Estimation

    MetricEstimate
    Character Count142
    Word Count24
    Estimated Tokens34
    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

    1. Use chunk_text if you need to split this data for a long-context prompt.
    2. Pass the repaired JSON directly into your application logic.
    3. Configure price_per_1k_tokens in 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

    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.

    How to use

    1. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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
    PythonGit

    Permissions

    Terminal / Shell
    Network Access
    Listed10 days ago

    What's inside

    Creator

    D

    dodon

    2 skills on Agensi

    Frequently Asked Questions

    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.

    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.

    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.

    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.

    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.

    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.

    Free