Skip to main content
Glama

evaluate_chunking

Benchmark chunking strategies for RAG corpora, dry-run cost estimates, and evaluate retrieval quality with generated or supplied datasets.

Instructions

Dry-run cost estimate or full evaluation (DummyEmbeddingFunction if no model).

content_type restricts strategies to those supporting it. The response includes a warnings list (e.g. when the trivial placeholder dataset is used).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>"
    },
    "name": "evaluate_chunking"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
top_kNoKept for compatibility; does NOT affect metrics or scores. Retrieval depth is the effective k = 2000-token context budget / avg chunk tokens.
dry_runNo
max_docsNo
use_caseNorag_qa
use_cacheNoUse the SQLite embedding cache for real embedding models.
strategiesNo
content_typeNo
dataset_pathNoOptional JSON/YAML eval dataset file (must be under CHUNK_TUNER_BASE_DIR). document_id may be the file path relative to `path`, an absolute path, or the file name. Mutually exclusive with generate_dataset.
embedding_modelNo
retrieval_scopeNoRanking used for score's rank metrics: 'document' (gold document's chunks only) or 'corpus' (all chunks of all documents).document
generate_datasetNoGenerate eval questions with the server's LLM (CHUNKTUNER_LLM_MODEL; may be paid). No confirmation prompt: call evaluate_chunking with dry_run=true and generate_dataset=true first to see llm_dataset_tokens / llm_cost_usd. The dataset is cached and reused for identical documents. Default: a trivial placeholder dataset (see `warnings` in the response).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.2.1
    • addedInput schema / properties / dataset_path
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Optional JSON/YAML eval dataset file (must be under CHUNK_TUNER_BASE_DIR). document_id may be the file path relative to `path`, an absolute path, or the file name. Mutually exclusive with generate_dataset.",
      +  "title": "Dataset Path"
      +}
    • addedInput schema / properties / generate_dataset
      Added value: +{
      +  "default": false,
      +  "description": "Generate eval questions with the server's LLM (CHUNKTUNER_LLM_MODEL; may be paid). No confirmation prompt: call evaluate_chunking with dry_run=true and generate_dataset=true first to see llm_dataset_tokens / llm_cost_usd. The dataset is cached and reused for identical documents. Default: a trivial placeholder dataset (see `warnings` in the response).",
      +  "title": "Generate Dataset",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / retrieval_scope
      Added value: +{
      +  "default": "document",
      +  "description": "Ranking used for score's rank metrics: 'document' (gold document's chunks only) or 'corpus' (all chunks of all documents).",
      +  "enum": [
      +    "document",
      +    "corpus"
      +  ],
      +  "title": "Retrieval Scope",
      +  "type": "string"
      +}
    • addedInput schema / properties / top_k / description
      Added value: +"Kept for compatibility; does NOT affect metrics or scores. Retrieval depth is the effective k = 2000-token context budget / avg chunk tokens."
    • addedInput schema / properties / use_cache
      Added value: +{
      +  "default": true,
      +  "description": "Use the SQLite embedding cache for real embedding models.",
      +  "title": "Use Cache",
      +  "type": "boolean"
      +}
  2. First observedv0.1.1

TDQS

C2.9/5.0
Behavior3/5

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

With no annotations, the description carries the full burden and does add useful behavior: silent fallback to ``DummyEmbeddingFunction`` when no model is supplied, strategy filtering by ``content_type``, and a returned ``warnings`` list flagging placeholder datasets. It omits runtime expectations, caching side effects, and the fact that LLM dataset generation can incur cost (only covered in the schema).

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?

Three tight sentences with the primary mode distinction front-loaded and no filler. The parentheticals earn their place by explaining the fallback and the warnings list, though the first sentence reads as a fragment that could be one clause clearer.

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?

For a 12-parameter evaluation tool with no annotations and no output schema, the description covers modes, one filtering parameter, and one response field, but leaves the overall return shape and most parameter behavior to the schema. It is adequate to start but not complete enough for confident first-call invocation.

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

Parameters3/5

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

Schema description coverage is only 42% across 12 parameters, so the description must compensate and does so partially: ``content_type`` gains the meaning that it restricts which strategies run, ``embedding_model`` gains the dummy-fallback semantics, and the ``warnings`` return value is explained. Many parameters (``path``, ``max_docs``, ``use_case``, ``strategies``, ``dry_run`` interaction) get no added meaning beyond their titles.

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

Purpose3/5

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

The description names the two operating modes (dry-run cost estimate vs. full evaluation) but never states the object of the evaluation, i.e. that it scores chunking strategies over documents at ``path``. It gives no differentiation from siblings like ``preview_chunks`` or ``recommend_config``, so an agent must infer scope from the tool name.

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

Usage Guidelines2/5

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

There is an implicit hint that dry-run precedes a real run, and that ``content_type`` narrows the strategy set, but no explicit when-to-use/when-not-to-use guidance. Nothing says when to prefer this over ``preview_chunks`` or ``recommend_config``, and the prerequisite ordering for ``generate_dataset`` is only documented in the schema, not the description.

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