Skip to main content
Glama
nongtiensonpro

Document RAG MCP

Document RAG MCP

Hệ Thống Document Intelligence & Hybrid Retrieval Toàn Diện Cho AI Agent

Một server Model Context Protocol (MCP) chuẩn mực, kết hợp sức mạnh của Trích xuất đa định dạng + Xác thực cấu trúc tự động + Kho dữ liệu quan hệ DuckDB (Read-Only SQL) + Tìm kiếm lai Vector Dense/Sparse (Qdrant) với BGE-M3 Cross-Encoder Reranker.


📑 Mục Lục


Related MCP server: Infino MCP server

1. Tổng Quan Kiến Trúc

Hệ thống hoạt động theo pipeline 4 tầng độc lập và song song:

Tài liệu đầu vào (PDF, DOCX, XLSX, CSV, PPTX, HTML, Markdown, TXT, XML)
                                  │
                    ┌─────────────┴─────────────┐
                    ▼                           ▼
          Tầng 1: TRÍCH XUẤT            (Mỗi định dạng có
          (Format-Specific Extractors)   Extractor chuyên biệt)
                    │
                    ▼
          Tầng 2: MÔ HÌNH TÀI LIỆU CHUẨN
          DocumentModel { sections[], tables[], metadata }
                    │
       ┌────────────┼────────────────┐
       ▼            ▼                ▼
  Tầng 3a:     Tầng 3b:        Tầng 3c:
  XÁC THỰC     LƯU TRỮ BẢNG   CHIA ĐOẠN
  (Validation)  (DuckDB)       (Chunking)
       │                             │
       ▼                             ▼
  Báo cáo lỗi              Tầng 4: TÌM KIẾM NGỮ NGHĨA
  & cảnh báo               Qdrant Vector Store
                            - Dense + BM25 Sparse (RRF)
                            - Multilingual Cross-Encoder Reranker
  • Nguyên lý thiết kế: Dữ liệu sau khi trích xuất được chuẩn hóa thành DocumentModel duy nhất. Dữ liệu bảng lập tức được nạp vào cơ sở dữ liệu quan hệ DuckDB để phục vụ các câu hỏi thống kê/tính toán chính xác $100%$, đồng thời chia đoạn thông minh nạp vào Qdrant để phục vụ tìm kiếm ngữ nghĩa mờ.


2. Tính Năng Nổi Bật

📄 1. Trích Xuất Chuyên Biệt Theo Định Dạng

  • Spreadsheet (.xlsx, .xls): Đọc trực tiếp qua openpyxl, tự động nhận diện header thống kê nhiều tầng, lan truyền ô gộp (merged cells), bảo toàn giá trị công thức tính toán.

  • Dữ liệu phân tách (.csv): Tự động nhận diện dấu phân cách (csv.Sniffer), thử nhiều bảng mã (utf-8, utf-8-sig, latin-1, cp1252).

  • Tài liệu Word (.docx): Tái hiện cây cấu trúc Heading 1 $\rightarrow$ Heading 2 $\rightarrow$ nội dung, trích xuất bảng nhúng.

  • Tài liệu PDF (.pdf): Tích hợp OCR bố cục trang, trích xuất cấu trúc bảng thông minh qua Docling.

  • Trình chiếu (.pptx): Trích xuất tiêu đề slide, bullet points, ghi chú thuyết trình (speaker notes) và bảng biểu.

  • Văn bản có cấu trúc (.md, .txt, .html, .xml): Phân tích cú pháp tiêu đề và trích xuất bảng HTML/XML.

🛡️ 2. Công Cụ Xác Thực Dữ Liệu Tự Động (Validation Engine)

  • Tự động không cần cấu hình:

    • Đối chiếu số lượng thực tế của từng sheet với số liệu khai báo trong sheet Tổng Hợp/Summary.

    • Tự động dò tìm cột số thứ tự (STT, ID) và phát hiện khoảng trống (gaps) hoặc số trùng lặp.

    • Phát hiện bản ghi trùng lặp khóa chính xuyên suốt các sheet con (Cross-sheet duplicate keys).

    • Phân tích thống kê phát hiện lỗi copy-paste nhầm tên sheet/danh mục.

  • Khai báo qua Rule JSON (rules/*.json): Hỗ trợ thiết lập ràng buộc required, required_any (nhóm cột ứng viên), unique, sequence theo từng mẫu tài liệu.

📊 3. Lưu Trữ & Phân Tích Quan Hệ (DuckDB Read-Only)

  • Mỗi bảng biểu trích xuất được tạo thành một bảng riêng biệt trong file tables.duckdb.

  • An toàn tuyệt đối: Lớp bảo vệ _validate_readonly_sql chỉ cho phép các câu lệnh đọc (SELECT, WITH, DESCRIBE, EXPLAIN, SHOW), ngăn chặn mọi hành vi thay đổi/xóa dữ liệu (DROP, DELETE, INSERT, multi-statement injection ;).

  • Cung cấp API aggregate để AI Agent tổng hợp dữ liệu dễ dàng mà không cần sinh câu lệnh SQL phức tạp.

🎯 4. Tìm Kiếm Lai & Xếp Hạng Lại (Hybrid Search & Reranking)

  • Tìm kiếm lai: Kết hợp Dense Vector + Sparse BM25 thông qua thuật toán Reciprocal Rank Fusion (RRF).

  • Reranker Đa Ngôn Ngữ: Sử dụng BAAI/bge-reranker-v2-m3 xếp hạng lại top kết quả với độ chính xác vượt trội.

  • Trích dẫn có căn cứ: Mỗi đoạn văn bản trả về đều kèm mã trích dẫn [S1], [S2] chỉ rõ tên file, tên sheet, khoảng dòng hoặc đường dẫn mục lục.


3. Cài Đặt & Khởi Động Nhanh

Yêu Cầu Hệ Thống

  • Python: 3.113.13

  • Công cụ quản lý: uv (khuyến nghị)

  • Cơ sở dữ liệu Vector: Qdrant (Docker hoặc Local Embedded)

Các Bước Cài Đặt

# 1. Clone mã nguồn dự án
git clone https://github.com/nongtiensonpro/document-rag-mcp.git
cd document-rag-mcp

# 2. Tạo file cấu hình môi trường
cp .env.example .env

# 3. Đồng bộ và cài đặt toàn bộ thư viện phụ thuộc
uv sync

# 4. (Tùy chọn) Khởi chạy Qdrant qua Docker nếu dùng Docker mode
docker compose up -d qdrant

4. Danh Sách & Chi Tiết 14 Công Cụ MCP

Server đăng ký sẵn 14 công cụ chuyên biệt:

STT

Tên Tool

Nhóm

Mô tả chi tiết

1

index_document

Nạp dữ liệu

Trích xuất, xác thực cấu trúc, lưu bảng vào DuckDB và nhúng vector một file. Hỗ trợ force=True (ép nạp lại) và async_index=True (chạy ngầm).

2

index_directory

Nạp dữ liệu

Quét nạp hàng loạt cả thư mục, hỗ trợ đệ quy, lọc đuôi file, báo cáo diff chi tiết (mới, sửa đổi, giữ nguyên, lỗi).

3

search_documents

Tìm kiếm

Tìm kiếm lai kết hợp Dense + BM25, rerank BGE-M3, hỗ trợ lọc theo metadata (sheet, file, ...) và trả về trích dẫn.

4

query_tables

SQL DuckDB

Chạy các câu truy vấn SQL phân tích chỉ đọc (SELECT, WITH, JOIN, GROUP BY) trên các bảng dữ liệu hoặc View hợp nhất (v_{doc_id}). Hỗ trợ cột _sheet_row để biết chính xác số dòng Excel.

5

aggregate

SQL DuckDB

API tổng hợp nhanh: đếm (count), tính tổng (sum), trung bình (avg), min, max theo nhóm cột.

6

list_tables

SQL DuckDB

Liệt kê danh sách toàn bộ các bảng và Unified View trong DuckDB kèm tên cột, kiểu dữ liệu, số dòng và file nguồn.

7

find_duplicates

SQL / Dedupe

Tự động tìm kiếm các bản ghi trùng lặp mã, tài khoản, STK, CCCD, ID xuyên suốt các sheet trong một tài liệu hoặc toàn bộ cơ sở dữ liệu.

8

reconcile_summary

Đối chiếu

Đối chiếu tự động số lượng khai báo trong sheet Tổng Hợp so với các sheet dữ liệu con, phát hiện các sheet bị bỏ sót (missing_from_summary) và sai lệch tổng cộng.

9

list_documents

Kiểm tra

Liệt kê toàn bộ tài liệu đã nạp kèm mã băm SHA-256, số chunk vector, số bảng và thời gian nạp.

10

get_document

Kiểm tra

Lấy toàn bộ nội dung chunk, các bảng và thông tin metadata chi tiết của một tài liệu theo document_id.

11

get_index_status

Hệ thống

Kiểm tra số lượng vector, số bảng DuckDB, dung lượng và danh sách các thư mục gốc được phép nạp.

12

health

Hệ thống

Kiểm tra kết nối tới Qdrant Vector Store và DuckDB backend.

13

get_config

Hệ thống

Xem cấu hình đang hoạt động của server (các khóa bảo mật tự động được ẩn).

14

get_job_status

Tác vụ ngầm

Kiểm tra trạng thái, tiến độ phần trăm và kết quả của tác vụ index bất đồng bộ theo job_id.


5. Hướng Dẫn Tích Hợp Chi Tiết Vào Hermes Agent

Dự án hỗ trợ 2 phương thức tích hợp vào Hermes Agent:

                  ┌─────────────────────────────────────┐
                  │          HERMES AGENT CORE          │
                  └──────────────────┬──────────────────┘
                                     │
           ┌─────────────────────────┴─────────────────────────┐
           ▼                                                   ▼
┌─────────────────────────────┐                     ┌─────────────────────────────┐
│  Cách A: Native User Plugin │                     │    Cách B: Std MCP Server   │
│   (~/.hermes/plugins/...)   │                     │      (config.yaml stdio)    │
│  - hermes plugins enable    │                     │  - Tự động spawn subprocess │
│  - Quản lý qua Desktop GUI  │                     │  - Chuẩn kết nối stdio JSON │
└─────────────────────────────┘                     └─────────────────────────────┘

Cách A: Sử dụng Native Hermes Plugin (Khuyến nghị cho CLI & Desktop)

Plugin đã được cài đặt sẵn tại C:\Users\<user>\AppData\Local\hermes\plugins\document-rag\ (hoặc lưu trong thư mục plugins/document-rag của dự án).

1. Kiểm tra & Bật Plugin qua Hermes CLI

# Xem danh sách plugin (document-rag sẽ xuất hiện trong danh sách)
hermes plugins list

# Bật plugin document-rag
hermes plugins enable document-rag

# Kiểm tra tính toàn vẹn (Diagnostics & Validation)
hermes plugins doctor document-rag

Kết quả hermes plugins doctor chuẩn:

Plugin Doctor: ...\plugins\document-rag
  manifest: document-rag 0.3.0 (standalone)
  OK: runtime discovery, manifest parsing, import, and registration passed
  registrations: 14 tool(s), 0 hook(s)

2. Tắt Plugin khi không sử dụng

hermes plugins disable document-rag

Cách B: Khai báo MCP Server trong config.yaml

Nếu bạn muốn cấu hình trực tiếp như một MCP Server độc lập trong file cấu hình của Hermes Agent (%LOCALAPPDATA%\hermes\config.yaml):

mcp_servers:
  document_rag:
    command: "uv"
    args:
      - "run"
      - "--project"
      - "D:/document-rag-mcp"       # ← Thay bằng đường dẫn tuyệt đối thư mục dự án của bạn
      - "document-rag-mcp"
    env:
      RAG_DOCUMENT_ROOT: "D:/document-rag-mcp/documents"
      QDRANT_URL: "http://localhost:6333"
      DUCKDB_PATH: "D:/document-rag-mcp/data/tables.duckdb"
      RAG_RULES_DIR: "D:/document-rag-mcp/rules"
      RAG_RERANKER_MODEL: "BAAI/bge-reranker-v2-m3"
      DENSE_MODEL: "sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2"
      SPARSE_MODEL: "Qdrant/bm25"
      HYBRID_PREFETCH_LIMIT: "24"
      DEFAULT_LIMIT: "6"
      MAX_LIMIT: "20"
      RAG_LOG_LEVEL: "INFO"
      DOCLING_DO_OCR: "true"
      DOCLING_DO_TABLE_STRUCTURE: "true"
    enabled: true
    timeout: 300
    connect_timeout: 120
    supports_parallel_tool_calls: false
    tools:
      include:
        - index_document
        - index_directory
        - search_documents
        - query_tables
        - aggregate
        - list_tables
        - find_duplicates
        - reconcile_summary
        - list_documents
        - get_document
        - get_index_status
        - health
        - get_config
        - get_job_status
      resources: false
      prompts: false

Quản lý trực quan trên giao diện Hermes Desktop

  1. Mở ứng dụng Hermes Desktop.

  2. Điều hướng vào menu Settings $\rightarrow$ Plugins hoặc MCP Servers.

  3. Bạn sẽ thấy plugin document-rag hiển thị với phiên bản 0.3.0 cùng đầy đủ danh sách 14 công cụ.

  4. Bạn có thể bật/tắt bằng nút gạt (Toggle switch) trực quan.


6. Cấu Hình Cho Các Client MCP Khác

Claude Desktop (claude_desktop_config.json)

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "document-rag": {
      "command": "uv",
      "args": [
        "run",
        "--project",
        "D:/document-rag-mcp",
        "document-rag-mcp"
      ],
      "env": {
        "RAG_DOCUMENT_ROOT": "D:/document-rag-mcp/documents",
        "DUCKDB_PATH": "D:/document-rag-mcp/data/tables.duckdb",
        "QDRANT_URL": "http://localhost:6333"
      }
    }
  }
}

Chuẩn Portable Agent Plugins v1 (agent-plugins.org)

Dự án đã tích hợp sẵn:

  • plugin.json: Khai báo metadata chuẩn quốc tế.

  • mcp.json: Khai báo khởi chạy tự động với placeholder ${PLUGIN_ROOT}.


7. Kịch Bản & Quy Trình Sử Dụng Mẫu

Dưới đây là ví dụ các câu lệnh thực tế mà AI Agent sẽ thực thi khi làm việc với tài liệu của bạn:

Kịch bản 1: Nạp & Xác thực một tài liệu mới

Yêu cầu người dùng: "Hãy nạp file báo cáo tài chính quý 3 reports/q3_finance.xlsx và kiểm tra xem có lỗi dữ liệu nào không."

AI Agent gọi tool:

index_document({
  "path": "reports/q3_finance.xlsx"
})

Kết quả trả về:

  • tables_stored: 4 (đã lưu 4 sheet vào DuckDB)

  • chunks_indexed: 18 (đã nhúng 18 đoạn vào Qdrant)

  • validation.status: "ok" (hoặc danh sách cảnh báo nếu phát hiện thiếu dòng, trùng lặp STT).


Kịch bản 2: Hỏi đáp ngữ nghĩa & tìm kiếm có căn cứ

Yêu cầu người dùng: "Chính sách bảo hành và điều khoản thanh toán trong hợp đồng mẫu quy định như thế nào?"

AI Agent gọi tool:

search_documents({
  "query": "chính sách bảo hành và điều khoản thanh toán",
  "limit": 5
})

Kết quả: Trả về các đoạn trích dẫn kèm điểm tương đồng (reranker score) và căn cứ chính xác [S1] hop_dong_mau.docx, Điều 5: Thanh toán, dòng 45-60.


Kịch bản 3: Thống kê & Tính toán số liệu chính xác 100%

Yêu cầu người dùng: "Tổng doanh thu của khu vực Miền Bắc trong bảng dữ liệu là bao nhiêu?"

AI Agent gọi tool:

// Bước 1: Liệt kê các bảng để lấy tên bảng và tên cột
list_tables()

// Bước 2: Chạy câu lệnh SQL chính xác
query_tables({
  "sql": "SELECT SUM(doanh_thu) AS tong_doanh_thu FROM t_a1b2c3d4_0 WHERE khu_vuc = 'Miền Bắc'"
})

Kịch bản 4: Nạp thư mục lớn ở chế độ chạy ngầm (Async Background Job)

Yêu cầu người dùng: "Hãy nạp toàn bộ tài liệu trong thư mục archive/2025/."

AI Agent gọi tool:

// Bắt đầu tác vụ chạy ngầm
index_directory({
  "dir": "archive/2025",
  "async_index": true
})
// Trả về: { "job_id": "job_987654", "status": "running" }

// Kiểm tra tiến độ
get_job_status({
  "job_id": "job_987654"
})
// Trả về: { "status": "completed", "progress": { "processed": 45, "total": 45 } }

8. Xử Lý Sự Cố & Câu Hỏi Thường Gặp

❓ 1. Lỗi: Đường dẫn file nằm ngoài phạm vi (RAG_DOCUMENT_ROOT)

  • Nguyên nhân: Bạn truyền đường dẫn tuyệt đối ở ổ đĩa khác hoặc ngoài thư mục RAG_DOCUMENT_ROOT.

  • Khắc phục: Sao chép file vào thư mục documents/ (hoặc thư mục đã khai báo trong RAG_DOCUMENT_ROOT) và truyền đường dẫn tương đối (ví dụ: index_document(path="subfolder/file.xlsx")).

❓ 2. Qdrant không kết nối được (Connection refused)

  • Khắc phục:

    • Nếu dùng Docker: Đảm bảo container đang chạy bằng lệnh docker compose up -d qdrant.

    • Nếu dùng local mode không cần Docker: Cấu hình QDRANT_LOCAL_PATH=./data/qdrant trong file .env.

❓ 3. Muốn ép nạp lại file khi nội dung không đổi

  • Khắc phục: Mặc định hệ thống so sánh SHA-256 để bỏ qua file không đổi nhằm tối ưu tốc độ. Để nạp đè lại, chỉ cần thêm tham số "force": true khi gọi index_document hoặc index_directory.


9. Cấu Trúc Thư Mục Dự Án

document-rag-mcp/
├── src/document_rag_mcp/
│   ├── server.py              # Entrypoint MCP server (khai báo 12 công cụ)
│   ├── rag.py                 # Pipeline điều phối chính (Extract → Validate → Store → Vector)
│   ├── config.py              # Đọc và resolve cấu hình độc lập CWD
│   ├── models.py              # Cấu trúc DocumentModel, Section, Table
│   ├── errors.py              # Định nghĩa mã lỗi chuẩn hóa
│   ├── utils.py               # Tiện ích tính hash, đường dẫn, text processing
│   ├── extractors/            # Tầng trích xuất đa định dạng
│   │   ├── base.py            #   Lớp trừu tượng BaseExtractor
│   │   ├── xlsx_extractor.py  #   Trích xuất Excel (.xlsx, .xls)
│   │   ├── csv_extractor.py   #   Trích xuất CSV (auto delimiter)
│   │   ├── docx_extractor.py  #   Trích xuất Word (.docx)
│   │   ├── pdf_extractor.py   #   Trích xuất PDF (Docling)
│   │   ├── pptx_extractor.py  #   Trích xuất PowerPoint (.pptx)
│   │   └── text_extractor.py  #   Trích xuất Markdown, TXT, HTML, XML
│   ├── validation/            # Tầng xác thực cấu trúc & dữ liệu
│   │   ├── engine.py          #   ValidationEngine & khử trùng lặp cảnh báo
│   │   ├── schema.py          #   ValidationRule, ValidationIssue schema
│   │   └── structural_rules.py#   Các quy tắc tự động (STT, summary, duplicate key)
│   ├── stores/                # Tầng lưu trữ
│   │   ├── table_store.py     #   DuckDB TableStore (bảo vệ SQL Read-Only)
│   │   └── vector_store.py    #   Qdrant Vector Store wrapper
│   ├── chunkers/              # Tầng chia nhỏ văn bản & bảng biểu
│   │   ├── table_chunker.py   #   Chia bảng (giữ header, row overlap)
│   │   └── text_chunker.py    #   Chia văn bản theo cấu trúc Heading
│   └── jobs/                  # Tầng quản lý tác vụ bất đồng bộ
│       ├── manager.py         #   JobManager (Thread pool)
│       └── worker.py          #   Hàm thực thi indexing worker
├── plugins/                   # Thư mục plugin đóng gói
│   └── document-rag/          #   Native Hermes Plugin (plugin.yaml, __init__.py)
├── rules/                     # Thư mục quy tắc kiểm tra JSON
│   └── _example.json          #   Mẫu khai báo quy tắc
├── documents/                 # Thư mục chứa tài liệu nạp mặc định
├── data/                      # Lưu trữ dữ liệu DuckDB & Qdrant local
├── tests/                     # Bộ kiểm thử tự động
│   ├── run_tests.py           #   Test runner thực thi
│   ├── test_models.py         #   Kiểm thử DocumentModel
│   ├── test_validation.py     #   Kiểm thử các quy tắc validation
│   ├── test_table_store.py    #   Kiểm thử DuckDB CRUD & SQL Read-Only
│   ├── test_chunkers.py       #   Kiểm thử chia đoạn bảng/văn bản
│   └── test_extractors.py     #   Kiểm thử các extractor
├── plugin.json                # Manifest chuẩn Portable Agent Plugins v1
├── mcp.json                   # Cấu hình MCP chuẩn Portable Agent Plugins v1
├── hermes.config.yaml.example # File cấu hình mẫu cho Hermes Agent
└── pyproject.toml             # Cấu hình gói và dependencies

10. Kiểm Thử

Để chạy toàn bộ bộ kiểm thử tự động (23 bài kiểm thử unit tests):

uv run python tests/run_tests.py

Kết quả kiểm thử chuẩn:

============================================================
 Running Document RAG MCP Test Suite
============================================================

[test_models]
  [PASS] test_document_model_summary
  [PASS] test_section_hierarchy
  [PASS] test_table_operations

[test_validation]
  [PASS] test_cross_sheet_duplicate_keys
  [PASS] test_data_sheet_with_tong_prefix_not_misclassified_as_summary
  [PASS] test_duplicate_keys
  [PASS] test_filename_vs_content
  [PASS] test_required_any
  [PASS] test_required_not_empty
  [PASS] test_row_count_vs_declared_subsheet_and_grand_total
  [PASS] test_sequence_continuity_duplicate
  [PASS] test_sequence_continuity_gap
  [PASS] test_validation_engine_deduplication
  [PASS] test_validation_engine_with_rules

[test_table_store]
  [PASS] test_settings_path_resolution_independent_of_cwd
  [PASS] test_table_store_crud_and_query
  [PASS] test_table_store_strictly_read_only_queries

[test_chunkers]
  [PASS] test_table_chunker_header_once_and_overlap
  [PASS] test_text_chunker_sections

[test_extractors]
  [PASS] test_csv_extractor
  [PASS] test_markdown_extractor
  [PASS] test_xlsx_extractor_headerless_summary_sheet
  [PASS] test_xlsx_extractor_merged_title_banner

============================================================
 Tests: 23/23 passed (0 failed) in 0.83s
============================================================

📄 Giấy Phép

Dự án được phát hành theo giấy phép MIT License.

Available Tools

12 tools
aggregateB

Simplified aggregation on a DuckDB table.

Easier than SQL for common count/sum/group-by queries. Example: aggregate(table="t_abc_0", group_by=["xã"], agg="count")

ParametersJSON Schema
NameRequiredDescriptionDefault
aggNocount
tableYes
filterNo
group_byYes
agg_columnNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.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 of behavioral disclosure. It communicates the core behavior of read-only aggregation and mentions common operations like count/sum/group-by, but it does not disclose limitations, edge cases, side effects, or behavior around filter and agg_column.

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 short and front-loaded, with the core purpose in the first sentence and a useful example following immediately. Every sentence earns its place, and there is no redundant filler.

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 output schema provides return-type context, and the example supports basic usage, but the tool is not fully described for all five parameters. Missing semantics for filter and agg_column leave meaningful gaps for an agent trying to use sum or filtered aggregations.

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

Parameters2/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 for parameter meaning. The example clarifies table, group_by, and agg, but filter and agg_column are left unexplained, including the crucial relationship between agg_column and agg for sum queries. This is only partial compensation for undocumented parameters.

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 clearly states the tool performs simplified aggregation on a DuckDB table, with a concrete example showing count/group-by usage. It is specific about the verb and resource, but it does not explicitly distinguish itself from sibling tools such as query_tables beyond the vague 'Easier than SQL' comparison.

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?

The phrase 'Easier than SQL for common count/sum/group-by queries' implies when to use the tool, but it does not name alternatives or state when not to use it. Usage guidance is present but only implied rather than explicit.

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

get_configA

Return safe read-only runtime configuration without secrets.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.2/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full disclosure burden. It explicitly discloses read-only behavior and the absence of secrets, which is valuable safety-relevant information. It does not discuss authentication or error behavior, but this is minor for a simple, parameterless reader.

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?

One tightly worded sentence carries the full semantic load: read-only, safe, runtime configuration, and no secrets. It is front-loaded and contains no filler or redundancy.

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?

With no parameters, no annotations, and an output schema present, this description is nearly complete for the agent's needs. It conveys what the tool returns and what it explicitly excludes. Slightly more context about the source or scope of the configuration could push it to a 5.

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?

The tool has zero parameters and schema description coverage is 100%, so there is nothing the description needs to explain about arguments. The baseline for parameterless tools is 4, and the description satisfies that without adding unnecessary parameter detail.

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 uses a specific verb ('Return') and resource ('runtime configuration'), and adds meaningful scope ('without secrets'). It clearly distinguishes itself from sibling tools focused on documents, tables, indexes, and status.

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?

The phrase 'runtime configuration' implies when the tool should be used, but the description does not explicitly state when not to use it or name alternatives. An agent must infer how this differs from get_document or get_index_status rather than being told.

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

get_documentA

Return all indexed chunks and provenance for one document id.

ParametersJSON Schema
NameRequiredDescriptionDefault
document_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.7/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 behavioral burden. It indicates a read operation via 'Return' but does not discuss error behavior, authentication requirements, or the potentially large payload implied by 'all indexed chunks'. This is adequate for a simple read but not richly transparent.

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 a single, front-loaded sentence with no wasted words. It states the action, the resource, and the scope in order of importance.

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?

An output schema exists, so return value details are covered elsewhere. However, the description does not mention how document_id should be obtained, what happens when the id is invalid or not yet indexed, or whether the response is large. For a one-parameter read it is nearly complete but leaves small, relevant gaps.

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?

With 0% schema description coverage, the description must add parameter meaning. It does clarify that document_id selects the document whose chunks and provenance are returned, but it does not specify the expected id format or how to obtain a valid id. This is minimal but useful context beyond the schema's type and title.

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 the verb and resource: 'Return all indexed chunks and provenance for one document id.' It specifies a single document id, which distinguishes this get-by-id tool from siblings like list_documents and search_documents without requiring the schema.

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?

The description implies the use case: call this when you have a specific document id and need its chunks/provenance. It does not mention alternatives or when not to use it, so usage guidance is only implied, not explicit.

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

get_index_statusA

Return Qdrant/DuckDB health, counts, roots and dependency versions.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the behavioral disclosure burden. It conveys a read-only status operation through 'Return', but it does not mention side effects, access requirements, or any potential performance considerations. This is adequate but not especially rich.

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?

A single, tightly worded sentance that front-loads the verb and resource. Every phrase adds meaningful information with no filler or repetition.

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?

For a parameterless status tool with an output schema available, the description supplies the key return categories (health, counts, roots, dependency versions) and scopes it to Qdrant/DuckDB. The main gaps are the unexplained 'roots' term and lack of differentiation from sibling health tools.

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?

The tool has zero parameters, so the schema has nothing to document. The description compensates by indicating what kind of information is returned, which is all an agent needs for parameterless invocation.

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 states a specific verb ('Return') and concrete subject matter (Qdrant/DuckDB health, counts, roots, dependency versions). This clearly identifies the tool's purpose, though 'roots' is somewhat ambiguous and there is no direct differentiation from sibling tools.

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?

No guidance is provided about when to use this tool versus alternatives such as 'health' or 'get_job_status'. The agent is left to infer the appropriate use case from the tool name and brief description alone.

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

get_job_statusC

Check the status of an async indexing job.

ParametersJSON Schema
NameRequiredDescriptionDefault
job_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It only says 'check the status' without noting whether the job may remain queued, whether the operation is idempotent and safe to pole, whether it can return errors after the job has failed, or whether results are singal-shot or persistent. For an async polling tool, this lacks meaningful behavioral context.

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?

One short sentence conveys the core purpose with zero filler. The phrasing is front-loaded and readable. However, it is terse to the point of omitting useful context, so it loses a point for under-specification rather than for waste.

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

Completeness2/5

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

Although the output schema exists so return values need not be described, there is no guidance on when to call this tool, where job_id comes from, or what behavioral expectations exist. Given the async nature and the presense of sibling tools like get_index_status and index_document, this description is incomplete for reliable tool selection and invocation.

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

Parameters2/5

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

Schema description coverage is 0%, so the tool description must compensate by explaining job_id. It does not. The parameter name alone is fairly self-evidt but the description does not clarify that job_id is the identifier returned by index_document or index_directory when an async job is created, nor does it mention any format or origin. This leaves the agent guessing where to obtain the ID.

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 states a specific verb ('Check') and a precise resource ('status of an async indexing job'). The 'async indexing job' qualifier differentiates this from the sibling get_index_status, which likely targets the overall index rather than an individual job. The purpose is unmistakable.

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?

No guidance is given on when to use this tool versus alternatives like index_document, index_directory, or get_index_status. There is no mention that this should be called with a job_id returned by an asynchronous indexing submision, and no exclusions or alternative routing are provided. The agent is left to infer usage context from the tool name alone.

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

healthA

Return a read-only health snapshot for this MCP and its backends.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.1/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 burden of behavioral disclosure. It clearly signals a read-only operation, which is valuable safety context. However, it does not describe what 'health' covers, whether it contacts live backends, or how results are returned; the output schema partially compensates.

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?

A single sentence with no wasted words. The most important information — that this is a read-only health snapshot covering the MCP and its backends — is front-loaded and immediately actionable.

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

Completeness5/5

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

For a zero-parameter health check, the description is sufficiently complete. It states the tool's purpose, scope, and read-only nature. The presence of an output schema covers return value details, so nothing critical is missing.

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?

The tool has zero parameters, so the input schema is already complete. The description does not need to explain parameter meaning, and the baseline of 4 applies. No parameter semantics are missing.

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 uses a specific verb ('Return') and resource ('read-only health snapshot for this MCP and its backends'). It clearly distinguishes this tool from siblings like get_index_status or get_job_status by framing it as a general health check across the MCP and its backends.

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?

The read-only health snapshot phrasing implies it is for checking system health, but the description does not explicitly state when to use this tool versus the alternative status/config tools. No exclusions or alternative routing are provided, so usage guidance is mostly implied rather than stated.

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

index_directoryA

Index supported files in a directory with diff reporting.

Returns which files are new, changed, unchanged, or failed. Set force=True to force re-indexing all files. Set async_index=True for large directories to prevent timeout.

ParametersJSON Schema
NameRequiredDescriptionDefault
dirNo.
forceNo
limitNo
patternNo**/*
recursiveNo
async_indexNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.5/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 disclosure burden. It does reveal meaningful behavior: diff reporting, force re-indexing behavior, and the timeout risk addressed by async_index. However, it does not mention side effects on the existing index, permissions needed, or whether indexing is safe/reversible, leaving the operational impact partially undisclosed.

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 compact and front-loaded. The first sentence states the core purpose, the second describes return categories, and the next two sentences flag the most important optional behaviors. Every sentence provides useful information with no filler.

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

Completeness2/5

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

An output schema exists, so return values do not need full description, and the description does summarize output categories. But with no annotations and no schema-level parameter docs, the description leaves key call semantics unexplained, especially limit, pattern, recursive, and how dir defaults to '.'. For a six-parameter tool, this is not complete enough.

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

Parameters2/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 for undocumented parameters. It only explains force and async_index; dir, limit, pattern, and recursive are left to bare titles and defaults. This is insufficient for a tool with six parameters.

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 states a specific verb and resource: 'Index supported files in a directory with diff reporting.' It also clarifies what the operation returns (new/changed/unchanged/failed files), which makes the tool's purpose concrete and distinct from sibling index_document by directory vs document scope.

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?

The description gives useful conditional guidance for force and async_index, but does not say when to choose this tool over alternatives like index_document, search_documents, or get_index_status. Usage context is mostly implied by the tool's purpose rather than explicitly stated.

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

index_documentA

Convert and index one document from a configured document root.

path may be relative to RAG_DOCUMENT_ROOT or an absolute path. Supports: PDF, DOCX, XLSX, CSV, PPTX, HTML, Markdown, TXT, XML. Returns validation results and diff info (skipped if unchanged). Set force=True to force re-indexing even if content hash is unchanged. Set async_index=True to run in background and return job_id.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes
forceNo
async_indexNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description carries the full burden, and it does well: it discloses that content hash is checked, that unchanged documents are skipped, that force overrides this, and that async_index shifts to background and returns a job_id. It aids the agent in predicting side effects and return behavior beyond the input schema. It stops short of a 5 because it doesn't mention error/validation-response specifics or permission prerequisites, though the output schema likely covers return structure.

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 compact, front-loaded with the main purpose, and each line adds concrete value: path resolution, supported formats, return behavior, force, and async options. There is no redundant or filler text.

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

Completeness5/5

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

Given a simple 3-parameter tool with an output schema and no nested objects, the description covers all relevant operational concerns: supported file types, path context, hash-change optimization, re-index override, and background execution mode. The agent has enough to select and invoke this tool correctly.

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?

Schema description coverage is 0%, so the description must compensate, and it does: it explains path semantics (relative vs absolute), force behavior (re-index despite unchanged hash), and async_index behavior (background execution, returns job_id). This gives the agent meaningful guidance that the raw schema field names alone would not provide.

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 opens with a specific verb and resource: 'Convert and index one document', which clearly differentiates this from sibling tools like index_directory (one vs. directory) and search_documents (indexing vs searching). The mention of 'one document' plus the supported format list fully establishes its purpose.

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?

It states that the tool handles a single document from a configured root, which implicitly tells the agent to choose index_directory for batch indexing. It also gives explicit guidance on when to use force=True and async_index=True, and describes the relative/absolute path options. It lacks an explicit when-not-to-use statement naming alternatives, which keeps it just shy of 5.

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

list_documentsA

List indexed files, hashes, chunk counts, timestamps and source paths.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4/5.0
Behavior3/5

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

There are no annotations, so the description carries the burden of behavioral disclosure. It conveys that this is a read-only listing operation and shows what data is returned, but it does not mention pagination, result size limits, ordering, or whether all indexed files are always returned.

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 one well-structured sentence with no filler. The verb and resource are front-loaded, and every listed field adds useful information about the output.

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?

For a zero-parameter tool with an output schema, this is largely complete: it identifies the resource and the key returned fields. The only notable gap is the absence of pagination or scale behavior, but since the tool takes no inputs and has an output schema, the description is adequate.

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?

The tool has zero parameters and the schema is empty, so there is nothing for the description to elaborate. The baseline of 4 applies because no parameter semantics are needed; the description appropriately focuses on the output.

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 uses a specific verb ('List') and resource ('indexed files'), and names the returned metadata fields (hashes, chunk counts, timestamps, source paths). This clearly distinguishes it from sibling tools like search_documents and get_document, which imply filtering or retrieving individual documents.

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?

The intended usage is implied by the word 'List' and the named fields, but the description does not explicitly say when to use this tool instead of search_documents or get_document. It also does not mention any alternatives or conditions that would exclude its use.

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

list_tablesA

List all extracted tables in the DuckDB relational store.

Returns table names, source documents, column schemas, and row counts.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations provided, the description carries the burden, and it does a good job for a list tool: 'List all extracted tables' clearly indicates a read-only operation and defines the scope, while the return-field list sets expectations. It does not mention potential performance characteristics or edge cases, but for a simple list operation this is sufficient.

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?

Two concise sentences with no filler. The primary action and scope are front-loaded, followed by the list of returned data, making it easy for an agent to parse quickly.

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

Completeness5/5

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

For a zero-parameter list tool with an output schema available, the description is complete. It states exactly what is listed and what information is returned, giving an agent all it needs to decide to call the tool.

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?

The input schema has zero parameters, so the baseline is 4. There are no parameter details to document, and the description appropriately focuses on the operation and return values rather than nonexistent arguments.

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 has a specific verb ('List'), a clear resource ('all extracted tables in the DuckDB relational store'), and enumerates the returned fields (table names, source documents, column schemas, row counts). This clearly distinguishes it from sibling tool list_documents.

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?

The action and scope imply usage for discovering available tables, but the description does not explicitly compare it with alternatives like query_tables or list_documents, nor state when not to use it. There is no explicit guidance on selection among siblings, so it earns an 'implied usage' score.

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

query_tablesA

Execute a SQL query on extracted tables stored in DuckDB.

Use list_tables() first to discover available table names and column schemas. Supports COUNT, GROUP BY, JOIN, WHERE, etc.

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.2/5.0
Behavior3/5

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

With no annotations, the description carries the transparency burden. It communicates that this is a read-style SQL query via supported operations like COUNT, GROUP BY, JOIN, and WHERE, which implies no data mutation. However, it does not explicitly state read-only behavior, result limits, or error/edge-case behavior, leaving some ambiguity for arbitrary SQL.

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?

Three short sentences, each earning its place: the core action, the prerequisite discovery step, and the supported SQL feature set. The most important usage instruction is front-loaded after the one-line purpose, with no filler or repetition.

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?

Given the tool has only one parameter and an output schema exists, the description covers the essential call context: what the SQL targets, how to find valid table names and schemas, and which operations are supported. It misses minor items like explicit read-only confirmation, but for a simple query tool with low parameter complexity it is adequately complete.

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?

The schema provides only the parameter name 'sql' with no description, so the description must compensate. It does so by clarifying that the parameter is a SQL query against DuckDB, listing supported clauses, and linking to list_tables for schema discovery. This is sufficient for the single parameter, though a small syntax example would make it even stronger.

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 states a specific verb and resource: 'Execute a SQL query on extracted tables stored in DuckDB.' It goes beyond a bare name by specifying the database engine and the supported SQL operations, making it clearly distinct from sibling tools like list_tables or aggregate.

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 explicitly instructs the agent to 'Use list_tables() first to discover available table names and column schemas,' which gives clear before-use context. It does not explicitly mention when not to use this tool or name an alternative for non-query needs, so it stops short of a full 5.

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

search_documentsA

Search indexed documents with hybrid dense+sparse retrieval.

Optionally filter by metadata (e.g. filter={"sheet_name": "Branch_Alpha"}). Results include structured citations with sheet name and row ranges. Cross-encoder reranking is applied when configured.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
queryYes
filterNo
document_idNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.5/5.0
Behavior4/5

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

With no annotations provided, the description carries the behavioral disclosure burden. It meaningfully explains hybrid retrieval, optional metadata filtering, structured citations, and cross-encoder reranking, which helps an agent anticipate results and configuration effects. It does not mention auth, rate limits, or whether results are paginated, but the disclosed retrieval behavior is substantive.

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 three focused sentences with the primary action front-loaded. The filter example and reranking note each add value without redundant filler, making it an efficient and well-structured definition.

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 description gives enough for a basic search call and mentions result citation structure, and an output schema is presumably available to define the return shape. However, the missing semantics for limit and document_id, plus the absence of explicit differentiation from query_tables, leave noticeable gaps for correct tool selection and full argument usage.

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

Parameters2/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, but it only addresses filter via an example and implicitly covers query. The limit and document_id parameters are not explained, leaving a significant semantic gap for agents that need to constrain result count or scope to a specific document.

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 the tool's action 'Search indexed documents' and adds a distinctive retrieval approach ('hybrid dense+sparse retrieval'), so the core purpose is clear. However, it does not explicitly differentiate this from sibling tools like query_tables, leaving some ambiguity about which search-like tool is appropriate.

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?

The description implies usage for searching indexed documents and shows an example filter key, but it gives no explicit guidance about when to prefer this tool over query_tables or when the alternative should be used. No exclusions or when-not-to-use conditions are mentioned.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 12 tool updatesv0.1.0
    • First observedaggregate
    • First observedget_config
    • First observedget_document
    • First observedget_index_status
    • First observedget_job_status
    • First observedhealth
    • First observedindex_directory
    • First observedindex_document
    • First observedlist_documents
    • First observedlist_tables
    • First observedquery_tables
    • First observedsearch_documents

TDQS

A3.7/5.0

Scored across 12 tools

Disambiguation4/5

Most tools target distinct resources or actions, but query_tables and aggregate overlap for table analytics, and get_index_status substantially overlaps with health. Descriptions help clarify intent, but an agent could occasionally select the wrong one.

Naming Consistency4/5

Tool names mostly follow a verb_noun snake_case pattern like list_tables, index_document, and get_config. The main inconsistency is the bare noun 'health' instead of something like 'get_health', and the mix of query/search/aggregate verbs is acceptable but slightly varied.

Tool Count5/5

Twelve tools is well-scoped for a document RAG server covering indexing, retrieval, table querying, and operational status. Each tool serves a credible purpose without feeling bloated or thin.

Completeness4/5

Core workflows are covered: indexing, directory indexing, search, document retrieval, table listing/querying, and status checks. The main gap is the lack of a delete/remove tool for indexed documents or tables, though force re-indexing mitigates updates.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides semantic code search and retrieval capabilities for AI agents, enabling them to query codebases using natural language with automatic learning, hybrid search, and intelligent chunking of functions and classes.
    10 npm
    30
    ISC
  • A
    license
    A
    quality
    A
    maintenance
    Enables AI agents to perform keyword, semantic, hybrid, and SQL retrieval over data stored on object storage or local paths, using a local embedding model without requiring an API key.
    15
    125 npm
    Apache 2.0
  • A
    license
    A
    quality
    A
    maintenance
    Enables coding agents to query local notes, decisions, docs, and code with hybrid retrieval (BM25 + embeddings + reranking) and get path:line citations. It provides tools like rag_query for full-corpus search and search_knowledge for project-scoped knowledge recall.
    2
    1
    MIT