Skip to main content
Glama

compile_ontology

Read-only

Compile a Markdown vault into a deterministic graph artifact with canonical nodes, edges, aliases, and optional indexes for graph queries, export, and cache checks.

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 full payload. summary: true returns counts + graphHash + byKind/byDomain aggregates with no arrays, for cheap polling, and a call with no argument that asks for arrays returns the same bounded summary plus delivery, which names the two ways to the rest: full: true for every array, or nodesLimit/nodesOffset / edgesLimit/edgesOffset to slice them. The response includes nodesPagination / edgesPagination meta with {offset, limit, total, returned, hasMore, nextOffset} when sliced.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fullNoWhen true, return every array however large the vault is (the answer without arguments is the bounded summary). Page arguments still slice nodes and edges.
summaryNoWhen 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. Wins over every other argument.
edgesLimitNoPositive integer max edges to return. Pair with `edgesOffset` to paginate. Max 500.
nodesLimitNoPositive integer max nodes to return. Pair with `nodesOffset` to paginate. Max 500; `full: true` without it returns every node.
edgesOffsetNoNon-negative integer starting index in the sorted edges array. Defaults 0.
nodesOffsetNoNon-negative integer starting index in the sorted nodes array. Defaults 0.
includeIndexesNoWhen 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

TableJSON Schema
NameRequiredDescriptionDefault
edgesNo
nodesNo
byKindYes
issuesNo
aliasesNo
indexesNo
summaryNo
versionYes
byDomainYes
deliveryNoPresent when no argument asked for arrays: this is the bounded summary, and these arguments return the rest.
maxMtimeYes
edgeCountYes
graphHashYes
nodeCountYes
aliasCountYes
issueCountYes
edgesPaginationNo
nodesPaginationNo
ambiguousAliasesNo
externalEdgeCountYes
resolvedEdgeCountYes
ambiguousAliasCountYes
referencedOnlyCountYes
skippedNonNodeCountNoSummary answers only: `.md` files passed over for having no `kind:`.
unresolvedEdgeCountYes
canonicalizationActionsNo
canonicalizationActionCountYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv1.4.0
    • addedInput schema / properties / full
      Added value: +{
      +  "description": "When true, return every array however large the vault is (the answer without arguments is the bounded summary). Page arguments still slice nodes and edges.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / nodesLimit / description
      Previous value: -"Positive integer max nodes to return. Pair with `nodesOffset` to paginate. Omit for unlimited (backward compat), max 500 when provided."New value: +"Positive integer max nodes to return. Pair with `nodesOffset` to paginate. Max 500; `full: true` without it returns every node."
    • changedInput schema / properties / summary / description
      Previous value: -"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."New value: +"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. Wins over every other argument."
    • addedOutput schema / properties / delivery
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Present when no argument asked for arrays: this is the bounded summary, and these arguments return the rest.",
      +  "properties": {
      +    "fullArguments": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "full": {
      +          "enum": [
      +            true
      +          ],
      +          "type": "boolean"
      +        }
      +      },
      +      "required": [
      +        "full"
      +      ],
      +      "type": "object"
      +    },
      +    "pageArguments": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "edgesLimit": {
      +          "minimum": 1,
      +          "type": "integer"
      +        },
      +        "nodesLimit": {
      +          "minimum": 1,
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "nodesLimit",
      +        "edgesLimit"
      +      ],
      +      "type": "object"
      +    },
      +    "reason": {
      +      "minLength": 1,
      +      "pattern": "^(?!\\s)(?!.*\\s$)(?!.*\\u0000).+$",
      +      "type": "string"
      +    },
      +    "selection": {
      +      "enum": [
      +        "summary_default"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "selection",
      +    "reason",
      +    "fullArguments",
      +    "pageArguments"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / skippedNonNodeCount
      Added value: +{
      +  "description": "Summary answers only: `.md` files passed over for having no `kind:`.",
      +  "minimum": 0,
      +  "type": "integer"
      +}
  2. Changed3 schema fields changedv1.2.5
    • addedOutput schema / properties / edges / items / properties / rationale
      Added value: +{
      +  "description": "One-line rationale stored with this relation in the source document's `relation_notes` map (written by `add_relation(why)`). Omitted when no note is stored for the target.",
      +  "minLength": 1,
      +  "pattern": "^(?!\\s)(?!.*\\s$)(?!.*\\u0000).+$",
      +  "type": "string"
      +}
    • addedOutput schema / properties / referencedOnlyCount
      Added value: +{
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "version",
      -  "graphHash",
      -  "maxMtime",
      -  "nodeCount",
      -  "edgeCount",
      -  "resolvedEdgeCount",
      -  "externalEdgeCount",
      -  "unresolvedEdgeCount",
      -  "aliasCount",
      -  "ambiguousAliasCount",
      -  "issueCount",
      -  "canonicalizationActionCount",
      -  "byKind",
      -  "byDomain"
      -]New value: +[
      +  "version",
      +  "graphHash",
      +  "maxMtime",
      +  "nodeCount",
      +  "edgeCount",
      +  "resolvedEdgeCount",
      +  "externalEdgeCount",
      +  "unresolvedEdgeCount",
      +  "referencedOnlyCount",
      +  "aliasCount",
      +  "ambiguousAliasCount",
      +  "issueCount",
      +  "canonicalizationActionCount",
      +  "byKind",
      +  "byDomain"
      +]
  3. First observedv0.13.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover readOnly/destructive/openWorld, and the description adds substantial extra context: 'side effect 0,' the MCP token cap risk on large vaults, the precedence of `summary` over other args, the fallback bounded summary with a `delivery` field, and the pagination meta shape. This is well beyond what structured fields provide.

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?

Front-loaded with the core purpose and usage trigger before diving into payload/pagination mechanics. It is dense and mostly earns its sentences, though the closing pagination-meta sentence overlaps with what the schema and output schema already convey.

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-required-param, read-only compile tool with an output schema, the description covers everything an agent needs: token-cap behavior, caching via graphHash/maxMtime, summary vs full vs paged modes, and precedence rules. Nothing material 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?

Schema coverage is 100%, so the baseline is 3, but the description adds interaction semantics the schema cannot express: that `summary` 'wins over every other argument,' that `full: true` returns every array while page args still slice, and how offsets/limits pair together. This is genuine added meaning over the schema.

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?

States a specific verb ('Compile') and resource ('the whole markdown vault') and enumerates the artifact contents (nodes, edges, aliases, issues, canonicalization actions, optional indexes). It also positions itself as 'the compiler-style read path,' which distinguishes it from siblings like query_ontology and validate_vault.

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?

Gives explicit when-to-use guidance: 'call it before advanced reasoning, indexing, export, or non-developer-friendly graph views.' It also explains when to use the cheap summary mode ('cheap polling'). It does not name specific alternative sibling tools for overlapping needs, so it falls short of a 5.

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