compile_ontology
Compile a Markdown vault into a deterministic graph of canonical nodes, edges, aliases, and issues. Returns a graphHash for cache invalidation, with summary and pagination options.
Instructions
Compile the whole markdown vault into a deterministic graph artifact: canonical nodes, edges, aliases, graph issues, graph-array canonicalization actions, and optional adjacency indexes. This is the compiler-style read path for graph-database-like use: call it before advanced reasoning, indexing, export, or non-developer-friendly graph views. Includes a stable semantic graphHash and maxMtime for cache invalidation. side effect 0. Large vaults (100+ nodes) can exceed the MCP token cap with the default full payload — use summary: true for cheap polling (counts + graphHash, no arrays), or nodesLimit/nodesOffset / edgesLimit/edgesOffset to slice arrays. The response includes nodesPagination / edgesPagination meta with {offset, limit, total, returned, hasMore, nextOffset} when sliced.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| summary | No | When true, omit `nodes` / `edges` / `aliases` / `ambiguousAliases` / `canonicalizationActions` / `indexes` arrays — return only `graphHash`, `maxMtime`, counts (`nodeCount`/`edgeCount`/`aliasCount`/...), and aggregate `byKind`/`byDomain` as counts. Cheap polling for cache invalidation and graph-size assessment. | |
| edgesLimit | No | Positive integer max edges to return. Pair with `edgesOffset` to paginate. Max 500. | |
| nodesLimit | No | Positive integer max nodes to return. Pair with `nodesOffset` to paginate. Omit for unlimited (backward compat), max 500 when provided. | |
| edgesOffset | No | Non-negative integer starting index in the sorted edges array. Defaults 0. | |
| nodesOffset | No | Non-negative integer starting index in the sorted nodes array. Defaults 0. | |
| includeIndexes | No | When true, include indexes `{out, in, byKind, byDomain, edgeById, aliasToSlug, uidToSlug, slugToUid, mergedUidToSlug}`. Graph traversal remains slug-based; UID indexes provide exact identity resolution. Defaults false to keep payload smaller. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edges | No | ||
| nodes | No | ||
| byKind | Yes | ||
| issues | No | ||
| aliases | No | ||
| indexes | No | ||
| summary | No | ||
| version | Yes | ||
| byDomain | Yes | ||
| maxMtime | Yes | ||
| edgeCount | Yes | ||
| graphHash | Yes | ||
| nodeCount | Yes | ||
| aliasCount | Yes | ||
| issueCount | Yes | ||
| edgesPagination | No | ||
| nodesPagination | No | ||
| ambiguousAliases | No | ||
| externalEdgeCount | Yes | ||
| resolvedEdgeCount | Yes | ||
| ambiguousAliasCount | Yes | ||
| unresolvedEdgeCount | Yes | ||
| canonicalizationActions | No | ||
| canonicalizationActionCount | Yes |