Skip to main content
Glama

prepare_for_rag

Convert a file or URL to Markdown, then split it into optimally-sized chunks
ready for insertion into a vector database or RAG pipeline. Returns a JSON
array of chunks with token counts, making this the single tool needed to go
from raw document to RAG-ready data.

Args:
    source: Either a URL (starting with http/https) or absolute file path
    source_type: Either "url" or "file". Default: "url"
    chunk_size: Target token count per chunk. Default: 512. Recommended range: 256-1024
    overlap: Token overlap between consecutive chunks to preserve context. Default: 50

Returns:
    JSON array of chunks, each with: chunk_id, text, token_count, char_count

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYes
overlapNo
chunk_sizeNo
source_typeNourl

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

TDQS

A4.3/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses the two-step process (convert to Markdown, chunk) and the return structure, along with defaults. Yet it does not mention potential side effects like network requests for URLs, supported input formats, error handling, or any limitations, leaving gaps in transparency.

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

Conciseness5/5

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

The description is well-structured: a concise summary sentence, followed by a clear Args list with bullet-like formatting, and a Returns section. Every sentence contributes information, with no redundancy or fluff, making it easy to scan.

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

Completeness4/5

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

The tool is relatively simple, and the description covers the core workflow: conversion, chunking, and output format. The return schema is also described. Minor omissions like supported file formats are likely covered by the sibling tool list_supported_formats, so the description is largely complete for the intended use.

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

Parameters5/5

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

The schema provides only parameter names, types, and defaults with no descriptions. The description adds significant meaning: source format constraints (URL or absolute path), source_type allowed values, chunk_size recommended range (256-1024), and overlap purpose. This fully compensates for the empty schema and enhances usability.

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

Purpose5/5

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

The description clearly states that the tool converts a file or URL to Markdown and then splits it into chunks for RAG pipelines. It specifies the output format (JSON array of chunks) and distinguishes itself from sibling conversion tools by performing both conversion and chunking, positioning it as the 'single tool needed'.

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

Usage Guidelines4/5

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

The description communicates that this is the complete tool for going from raw document to RAG-ready data, implying its use when both conversion and chunking are needed. However, it does not explicitly mention alternatives or when not to use it, so it falls short of fully explicit usage guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4.2/5.0
Disambiguation2/5

Several tools overlap: convert_url already supports ArXiv and YouTube, making convert_arxiv and convert_youtube redundant. convert_with_metadata duplicates convert_file/convert_url but adds a metadata header. Agents must read descriptions carefully to choose correctly.

Naming Consistency5/5

All tool names follow a consistent snake_case verb_noun pattern: convert_*, count_tokens, list_supported_formats, prepare_for_rag. No mixed conventions or vague verbs exist.

Tool Count5/5

9 tools is well-scoped for a document conversion service. Each tool has a distinct role (file, URL, batch, metadata, token counting, format listing, RAG preparation) without being bloated.

Completeness5/5

The domain of converting sources to Markdown is thoroughly covered: files, URLs, batch conversion, metadata, token counting, and RAG chunking. The only minor redundancy is the specialized source converters, but the core workflow is complete.

Resources