Skip to main content
Glama
InfinityScrape MCP

InfinityScrape MCP

optimize_rag_chunks

Split large Markdown or text into header-aware semantic chunks with token counts and section headers for efficient LLM embeddings and context management.

Instructions

Semantic RAG Chunker & Token Optimizer: Splits large scraped web documents into header-aware semantic chunks with token counts and section headers for LLM embeddings and context efficiency.

Args: text_or_markdown: The large Markdown or text string to chunk. max_chunk_chars: Maximum characters per chunk (default 2000 ~500 tokens).

Input Schema

NameRequiredDescriptionDefault
max_chunk_charsNo
text_or_markdownYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full behavioral burden. It usefully discloses that chunking is header-aware and that output includes token counts and section headers, and it gives a default size with a token equivalence (2000 chars ~500 tokens). However, it says nothing about whether all input content is preserved, whether chunks overlap, what happens to sections that exceed max_chunk_chars, or any size or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The definition is short and front-loaded: a one-line summary of what the tool produces, followed by a compact Args block. The Args block partially restates the schema, which is mild redundancy, but nothing is bloated or padded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple (two parameters, one required) and an output schema exists, so return-value documentation is not required. Still, key behavioral questions for a chunker, content preservation, overlap, oversized-section handling, and input size limits, are unanswered, leaving the definition adequate but with clear gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it documents both parameters: text_or_markdown as the input string to chunk, and max_chunk_chars with its default and an approximate token conversion. The token equivalence is genuinely additive information not present in the schema. It stops short of explaining splitting behavior when a single section exceeds the limit.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource: splits large scraped web documents into header-aware semantic chunks with token counts. It also states the downstream purpose (LLM embeddings, context efficiency). It does not explicitly contrast itself with sibling tools such as extract_structured or scrape_url, but the resource is distinct enough that confusion is unlikely.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied via the phrase 'for LLM embeddings and context efficiency', which suggests a post-scrape, pre-embedding step. There is no explicit when-to-use or when-not-to-use guidance, and no sibling tool is named as an alternative for pre-chunking or post-processing. The agent must infer the pipeline position.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.