FastMCP server for taxonomy-aware RAG corpus construction from structured lore documents
Two well-defined tools with complete input schemas, clear descriptions, and thoughtful parameter constraints. chunk_document has excellent documentation with concrete examples (size_band values). tag_chunks includes cost transparency and environment variable requirements. Both tools have proper type annotations and validation ranges (min_words 50-2000, batch_size 1-25). Descriptions are 150-250 chars, within the 10-1024 baseline. However, output schemas are not explicitly documented in the code, return types are inferred from Chunk/list[Chunk] type hints but lack field-level documentation. Error handling is minimal; no recovery guidance for common failures (missing API key, invalid vocabulary size, malformed content). No tool annotations (readOnlyHint, destructiveHint) despite tag_chunks making external API calls and incurring costs.
Split a document into size-banded, section-aware chunks. Returns a list of Chunks ready to be tagged and/or ingested into a vector store. Chunks never span a heading boundary, never split mid-sentence, and fall in the range ``[min_words, max_words]``. Typical size_band values: - (200, 400) — default, suitable for most RAG use cases - (100, 250) — tighter, better when context window is precious - (400, 800) — wider, for richer chunks when retrieval precision matters less
Tag each chunk with 2-4 values from a controlled vocabulary via Gemini. Returns new Chunks with ``tags`` populated. Purely factual chunks come back with ``tags=[]`` — filter those downstream if they're noise for your use case. Cost: ~$0.04 per 1000 chunks at Gemini 2.5 Flash-lite default pricing. Requires: GEMINI_API_KEY or GOOGLE_API_KEY environment variable.
Output schemas not documented. Chunk model structure (fields, types) is not visible in tool descriptions or docstrings. LLMs cannot plan downstream operations without knowing what fields to extract.
No error handling guidance. Missing API key, invalid vocabulary (< 5 or > 60 tags), or malformed content will fail silently or with generic exceptions. No recovery hints for LLMs.
tag_chunks lacks tool annotations. Makes external API calls (Gemini) and incurs costs (~$0.04/1000 chunks). Should declare readOnlyHint=false and include cost/side-effect warnings in description.
No pagination or result limits documented. chunk_document can return unbounded lists for large documents. No guidance on max chunks per call or memory implications.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 62 | 2026-07-28+ | v2 |
Vocabulary parameter validation is weak. Accepts 5-60 char strings but does not validate that vocabulary items are unique, non-empty, or free of special characters. LLMs may pass duplicates or invalid tags.