This document defines the schema for metadata.json, the build artifact generated by @speakeasy-api/docs-mcp-core alongside the LanceDB index. It acts as the bridge between the indexing pipeline and the runtime server, providing the dynamic taxonomy and operational metrics required to boot the MCP tools.
{
// Required semver for forward/backward compatibility checks.
// Example: "1.1.0"
"metadata_version": "1.1.0",
// User-configured. The server injects this into dynamic tool descriptions
// so the LLM knows what the corpus is and when to search it.
"corpus_description": "Speakeasy SDK documentation",
// Taxonomy fields discovered during indexing.
// Keys are the field names.
// The server maps each key into a JSON Schema enum on the search_docs tool.
"taxonomy": {
"language": {
"description": "Filter results by programming language.",
"values": ["go", "java", "python", "typescript"]
},
"scope": {
"description": "Filter by documentation scope.",
"values": ["global-guide", "sdk-specific"]
}
},
// Corpus-level stats for observability and the eval harness.
"stats": {
"total_chunks": 2847,
"total_files": 312,
"indexed_at": "2026-02-21T14:32:00Z",
// Optional source traceability marker when the corpus came from Git.
// Null for non-git/local corpora.
"source_commit": "4d2f9b4d6a42c377815f9f6c7db25a54d2aa9cf9"
},
// The embedding provider used at build time (if any).
// Null means FTS-only index — the server disables vector search.
"embedding": null,
// Optional MCP prompts discovered from *.template.md and *.template.yaml files.
// These files are excluded from search indexing and exposed via prompts/list + prompts/get.
"prompts": [
{
"name": "guides/convert-currency",
"title": "Convert Currency",
"description": "Convert 100 USD to a target currency.",
"arguments": [
{
"name": "currency",
"description": "The target currency for conversion",
"required": true
}
],
"messages": [
{
"role": "user",
"content": {
"type": "text",
"text": "Convert 100 USD to {{currency}}. Use current forex mcp tools and APIs if available."
}
}
]
}
]
}embedding may also be:
{
"provider": "openai",
"model": "text-embedding-3-large",
"dimensions": 3072
}metadata_version- Must be valid semver (
MAJOR.MINOR.PATCH). - Server must fail fast if major version is unsupported.
- Must be valid semver (
taxonomynormalization- Keys are trimmed.
valuesarray: items are trimmed, deduplicated, sorted ascending. Canonical casing is preserved as discovered in the corpus (no forced lowercase).- Empty strings are rejected.
descriptionis optional. If omitted, the server defaults to"Filter results by {key}."
taxonomylimits- Max keys:
64 - Max key length:
64chars - Max values per key:
512 - Max value length:
128chars
- Max keys:
stats.source_commit- Optional.
- If present, must be a 40-char lowercase Git SHA-1.
- Used for provenance and eval traceability; never a runtime boot blocker.
embedding- Type:
null | { provider: string; model: string; dimensions: number } - If object is provided,
dimensionsmust be> 0.
- Type:
prompts- Type: optional array of
{ name, title?, description?, arguments[], messages[] }. nameis required non-empty string.messagesmust be a non-empty array of{ role, content }whereroleisuser|assistantandcontentis currently text ({ type: "text", text }).argumentsentries requirename; support optionaldescriptionandrequired.
- Type: optional array of
metadata_version: Enables explicit compatibility checks as the contract evolves, preventing silent runtime drift between indexers and servers.corpus_description: A key feature highlighted in the architecture documentation. It needs to flow from the build configuration (docs-mcp build --description "...") into the runtime server without requiring the server to parse external config files (like agen.yaml) itself.taxonomy: This is the load-bearing field for the Dynamic Schema feature. The server reads it at boot to injectenumarrays into thesearch_docsJSON Schema. Keys are strictly dynamic (not hardcoded tolanguage), guaranteeing the core engine remains domain-agnostic per the architecture's design goal.stats: Cheap to compute at index time, useful for the eval harness and the Host's telemetry pipeline.source_commitadds lightweight source provenance without introducing brittle boot-time coupling.embedding: The runtime server needs to know whether to execute vector search pathways (table.search().nearestTo()) or fall back to pure FTS if the index was built with--embedding-provider none. It is also required by the eval harness to record the specific provider/model permutation in its markdown delta reports.prompts: Allows docs authors to ship reusable MCP prompts next to docs content via*.template.md(single user-text shorthand) and*.template.yaml(multi-message format), while keeping prompt templates out of search indexing.
- Written by:
@speakeasy-api/docs-mcp-cli(driving@speakeasy-api/docs-mcp-core) during thedocs-mcp buildstep. Saved directly alongside the.lancedb/directory. - Read by:
@speakeasy-api/docs-mcp-serverat boot (to construct the dynamic JSON Schema for MCP tools) and@speakeasy-api/docs-mcp-eval(to record execution metadata in benchmarking reports). - Never read by: The CLI authoring tools (
validate,fix). These commands operate strictly on the markdown source content and manifests, not on build artifacts.