Skip to main content
Glama

query_ontology

Read-only

Run graph-database-style queries over a compiled ontology to trace dependencies, paths, impact, reachability, and schema without pulling the full compile payload.

Instructions

Analysis archive: analysis_history reads immutable diagnostic Markdown summaries without compiling the graph; use analysisMode, project, limit (1–100 scanned files, default 30), and analysisCursor. analysis_record reads one exact run or review with recordId (UUID). Records retain raw answers, full-body evidence when available, request scope and uncertainty. They are not approved ontology facts; stored qualification describes captured evidence, never current source validity. Reviews are joined to their exact run/finding id. Follow pagination even if a filtered page is empty. These archive operations do not support query_plan. Run graph-engine queries over the freshly compiled ontology artifact. Operations: neighbors (local graph neighborhood), path (one compiled-edge route between two nodes with aligned nodes[] summaries), all_paths (bounded simple paths between two nodes with per-path nodes[] summaries plus limit/searchBudget/exhaustive/truncatedByBudget/totalPathsExact metadata and evidence guidance), query_plan (EXPLAIN-style side-effect-free cost/index estimate plus execution advice before a target operation, filter-preserving suggestedQuery, and filter-aware estimate.totalMatches for match_nodes/match_edges), centrality (PageRank-style core-node ranking plus bridge/authority/hub lists), communities (label-propagation clusters inside the graph), similar_nodes (duplicate/overlap candidates before writes), explain_relation (direct edges, shortest path, and shared-neighbor explanation between two nodes), reachability (transitive graph closure from a start node), pattern_walk (explicit relation-sequence paths such as project → domains → capabilities), impact (incoming by default: what depends on this node), blast_radius (impact grouped by kind/domain with cross-domain edge risk), subgraph (bounded N-hop graph slice for UI/agent views), builder_context (persisted Workshop focus, layout positions, direct graph slice, and safe write handoff; unsaved UI drafts are explicitly excluded; operation name retained for compatibility), overview (counts, relation distribution, and hubs), schema (kind-relation-kind patterns), facets (filter/dashboard aggregates), match_nodes (graph DB-style node rows with degree filters plus a followUp packet for the first returned row), match_edges (graph DB-style edge pattern rows plus a followUp packet for the first returned real edge), node_profile (single node detail dashboard), domain_profile (domain detail dashboard), domain_matrix (domain-to-domain coupling), project_scope (project-contained graph slice), project_map (domain-by-domain project map), relation_check (schema-aware preflight before add_relation), components (connected graph islands), lineage and containment_tree (project/domain/capability containment), cycles (directed dependency-cycle checks), topological_order (prerequisite-first dependency ordering), recommend_relations (safe domain-containment suggestions), growth_plan (side-effect-free ontology expansion candidates, plus a nextReads group that turns the ## Uncertainty section of each node into the reads it asks for: kind, the statement as written, the paths and line ranges it names, and a one-sentence proposed read plus patch_concept, ordered cheapest-first and reporting reason: no_bodies when no node bodies were loaded), maintenance_plan (ordered post-write graph cleanup/repair actions with stable action id, count-safe summary fields, byPhase / bySeverity / byKind remaining-queue buckets, ready cursor cursor.found=true / cursor.reason=null, cursor nextAfterActionId/hasMore pagination metadata, afterActionId resume, unknown-cursor empty page with cursor.nextAfterActionId=null / cursor.hasMore=false, kind filters, executable graph-array canonicalization, executable flags, and current-page nextExecutableAction / nextReviewAction pointers), agent_brief (Claude Code/Codex handoff prompt, structured businessOntologyLens with business-first outcome → domain → capability → element read order, graphDbQueryPack for facets, schema, match_nodes, match_edges, domain_matrix, centrality, all_paths, explain_relation, and business_questions scans for outcome / domain boundary / capability claim nodes / implementation evidence edges, structured cliFallbackCommands, recipes, graph entrypoints, graph_traversal playbook, traversalStrategy plan_before_enumeration/bounded_path_evidence/containment_cross_check guidance, playbook evidence/stopWhen checklists, write guardrails, relationDecisionGuide, resultContracts for all_paths completeness and match_nodes/match_edges followUp evidence, and read-first write policy), meaning_repair_review (provenance-bound, byte-bounded typed evidence pages and literal full-body read calls for the compact meaning repair manifest), workspace_brief (first-contact status + next actions), and health (one-shot graph integrity dashboard whose relationCensus labels compiler declaration counts and the nonnumeric canonical app-map comparison unit). For agent_brief, select project explicitly when the vault has more than one project. Omitted detail and detail:"full" return the complete project-scoped diagnostic contract. For a known coding task, call detail:"compact" directly after connection_info; do not precede it with workspace_brief or a full inventory unless the question needs whole-vault health. Compact v2 requires a nonblank request-local task (max 2000 characters) and returns at most 12000 UTF-8 JSON bytes: final source/meaning currentness, claim-compatible broad capability selection, persisted element/path evidence, explicit unknown impact and verification, exact full-body next reads, and a detail:"full" follow-up. Definition and Includes support desired work; Excludes may align with explicit non-goals, while a desired/negative boundary conflict, an unsupported claim, or a tied top claim returns no capability. Its content[0].text is the bounded handoff prompt while structuredContent carries the typed facts once. When the selected element Markdown contains reviewed Primary implementation / Supporting implementation / Focused test coordinates and the bound source is current, taskNavigation verifies only those named files and returns exact current lines plus the reviewed non-exhaustive IN/OUT boundary. After those reads, Atlas rechecks the same source identity, fingerprint, revision, and graph hash; any mismatch removes the exact target and downgrades the complete outer currentness contract. A ready prompt reads primary, supporting, focused tests, and a verified manifest together; requires named positive and negative regression tests with exact observable output; and runs the focused check once followed by one non-overlapping full check. Missing, ambiguous, stale, unsafe, or unrecorded coordinates emit no exact target. Task matching selects evidence only; it never searches the repository, never proves source behavior, never persists task text, never approves meaning, and never writes the vault. For impact and blast_radius, only declared depends_on is allowed; use reachability/subgraph for structure. Blast radius reports unknown risk/completeness plus review_required or declared_with_rationale edge qualification until relation-level source receipts exist. A missing depends_on preflight is schema-only: relation_check returns proposedAction:null plus a non-writing approvalGate until the agent explains the observable ability and semantic rationale and receives explicit human approval. Accepts canonical slugs or unique aliases. side effect 0. Use this when you need graph-database-like answers without pulling the full compile_ontology payload.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoTarget node slug or unique alias. Required for path, all_paths, and explain_relation.
fromNoSource node slug or unique alias. Required for path, all_paths, and explain_relation.
kindNomatch_nodes: optional node kind filter (project, domain, capability, element, document, vault-readme). recommend_relations currently supports capability or element.
seedNoAlias for slug when operation is subgraph or builder_context.
slugNoCenter/root node slug or unique alias. builder_context also accepts its own canonical Workshop focusParam (for example domain:auth). Required for neighbors, reachability, pattern_walk, impact, blast_radius, subgraph, builder_context, lineage, node_profile, and domain_profile; optional root for containment_tree.
sortNomatch_nodes only: sort rows by degree, inDegree, outDegree, or slug. Defaults to degree.
taskNoagent_brief detail:"compact" only: request-local coding task used to select persisted capability, element, and reviewed navigation evidence after Definition/Includes/Excludes compatibility. Conflicting, unsupported, or tied claims return no capability. Never persisted, never used to invent a coordinate, and never treated as behavior proof or semantic approval.
typeNoRelation type for relation_check/match_edges, e.g. depends_on, relates, contains, describes, domains, capabilities, elements, or domain.
depthNoreachability/impact/blast_radius/subgraph/lineage/containment_tree traversal depth. Defaults to 3 for reachability, 2 for impact/blast_radius/subgraph, and 20 for lineage/containment_tree; capped at 20.
kindsNomaintenance_plan only: optional action-kind filter, e.g. ["add_missing_relation", "canonicalize_graph_arrays"].
limitNoPositive integer max rows/components/order entries to return. Defaults to 100, capped at 500.
titleNosimilar_nodes only: proposed title for a not-yet-written concept candidate.
typesNoOptional relation types to include, e.g. ["dependencies"] or ["depends_on"].
cursorNomeaning_repair_review only: opaque stateless cursor returned as pagination.nextCursor. Omit for the first page.
detailNoagent_brief only: compact v2 returns a task-scoped, selected-project handoff capped at 12000 UTF-8 JSON bytes, including exact reviewed taskNavigation only when the bound source is current; full returns the complete diagnostic manuals and graph packs. Omit to keep the current full response while compact is being qualified.
domainNomatch_nodes: optional exact domain filter. domain_profile: domain root slug or unique alias.
phasesNomaintenance_plan only: optional phase filter, e.g. ["repair", "link", "materialize"].
toKindNomatch_edges only: optional target kind filter (project, domain, capability, element, document, vault-readme, external, unresolved). Use external or unresolved for non-node refs.
maxHopsNopath/all_paths/explain_relation traversal hop cap or cycles max depth. Defaults to 5 for path/all_paths/explain_relation and 8 for cycles; capped at 20.
patternNopattern_walk only: required relation sequence to follow, e.g. ["domains", "capabilities", "elements"]. depends_on is normalized to dependencies.
projectNodomain_matrix/project_scope/project_map/agent_brief/meaning_repair_review: project root slug or unique alias. Required for meaning_repair_review; optional when exactly one kind: project node exists for the other operations.
fromKindNomatch_edges only: optional source node kind filter (project, domain, capability, element, document, vault-readme). Source must be a real ontology node, not external/unresolved.
recordIdNoanalysis_record only: immutable analysis or diagnostic-review UUID.
relationNoAlias for type when operation is relation_check.
directionNoneighbors/reachability/impact/blast_radius/subgraph/builder_context: incoming, outgoing, or both. path/all_paths/explain_relation/reachability also accepts undirected.
itemLimitNoproject_map only: positive integer max capability/element/hotspot summaries per domain. Defaults to 20, capped at 500.
maxDegreeNomatch_nodes only: non-negative integer maximum total graph degree.
minDegreeNomatch_nodes only: non-negative integer minimum total graph degree.
nodeLimitNocomponents/communities/health/workspace_brief/agent_brief only: positive integer max node summaries per component/community group. Defaults to 25 for components/communities and 10 for health, capped at 500.
operationYesQuery operation to run.
cycleLimitNohealth/workspace_brief/agent_brief only: positive integer max dependency cycles to inspect. Defaults to 5, capped at 500.
iterationsNocentrality/communities only: positive integer PageRank or label-propagation iteration count. Defaults to 20, max 100.
orderLimitNohealth/workspace_brief/agent_brief only: positive integer max topological-order rows to inspect. Defaults to 20, capped at 500.
severitiesNomaintenance_plan only: optional severity filter, e.g. ["fail", "warn"].
hasIncomingNomatch_nodes only: require presence or absence of incoming graph edges.
hasOutgoingNomatch_nodes only: require presence or absence of outgoing graph edges.
minInDegreeNomatch_nodes only: non-negative integer minimum incoming graph degree.
analysisModeNoanalysis_history only: optional analysis subject filter.
minOutDegreeNomatch_nodes only: non-negative integer minimum outgoing graph degree.
searchBudgetNoall_paths, query_plan(all_paths), and cycles: maximum DFS states to expand before returning partial results. Defaults to 5000. For cycles, `limit` trims only the listed rows and this budget is the one bound that can cut the count short — when truncatedByBudget is true, totalCycles is a lower bound and zero cycles does NOT mean acyclic (check totalCyclesExact).
slugContainsNomatch_nodes only: optional case-insensitive substring filter on canonical slug.
afterActionIdNomaintenance_plan only: stable action id cursor; return actions after this id. Without afterActionId the ready page reports cursor.found=true and cursor.reason=null; cursor.nextAfterActionId matches the last returned action id (or null for an empty page), and cursor.hasMore matches whether more remaining actions exist after this page. nextExecutableAction/nextReviewAction point only at the first executable/review action in the current returned page and preserve that action id, executable flag, phase, kind, and severity. Bucket totals (byPhase, bySeverity, byKind) match remainingActions for the returned cursor. Unknown cursors return an empty page with cursor.found=false, cursor.reason, zero remaining actions, cursor.nextAfterActionId=null, cursor.hasMore=false, and no next actions.
candidateSlugNosimilar_nodes only: proposed slug for a not-yet-written concept candidate.
analysisCursorNoanalysis_history only: nextCursor from the preceding scanned-file page.
componentLimitNohealth/workspace_brief/agent_brief only: positive integer max connected components to inspect. Defaults to 5, capped at 500.
componentTypesNohealth/workspace_brief/agent_brief only: relation types used for connected-component checks. Defaults to the full graph relation set.
executableOnlyNomaintenance_plan only: when true, return only actions with a proposed tool call.
includeOrphansNocontainment_tree only: include ancestorless nodes not reached from project roots. Defaults false.
reviewRevisionNomeaning_repair_review only: sha256 revision from meaningRepair:v2, binding graph/source/typed rows/target mtimes.
dependencyTypesNohealth/workspace_brief/agent_brief only: dependency relation types used for cycle and topological-order checks. Defaults to ["dependencies"].
includeExternalNoneighbors only: include external path-like element refs. Defaults false.
includeIsolatedNotopological_order only: include nodes that are not connected by the selected relation types. Defaults false.
targetOperationNoquery_plan only: read-only graph operation to explain before execution. Excludes query_plan, meaning_repair_review, analysis_history and analysis_record.
expectedGraphHashNomeaning_repair_review first page: exact graphHash from meaningRepair:v2 provenance. Later nextCall values are revision-bound and omit it.
includeUnresolvedNoneighbors only: include dangling unresolved refs. Defaults false.
recommendationLimitNohealth/workspace_brief/agent_brief only: positive integer max relation recommendations to inspect. Defaults to 20, capped at 500.
expectedSourceFingerprintNomeaning_repair_review first page: exact current sourceFingerprint from meaningRepair:v2 provenance. Later nextCall values are revision-bound and omit it.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationYes
compiledSummaryNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.4.0
    • changedInput schema / properties / searchBudget / description
      Previous value: -"all_paths, query_plan(all_paths), and cycles: maximum DFS states to expand before returning partial results. Defaults to 5000. For cycles this is the only bound that fires on an ACYCLIC graph — when truncatedByBudget is true, zero cycles does NOT mean acyclic (check totalCyclesExact)."New value: +"all_paths, query_plan(all_paths), and cycles: maximum DFS states to expand before returning partial results. Defaults to 5000. For cycles, `limit` trims only the listed rows and this budget is the one bound that can cut the count short — when truncatedByBudget is true, totalCycles is a lower bound and zero cycles does NOT mean acyclic (check totalCyclesExact)."
  2. Changed2 schema fields changedv1.3.0
    • changedInput schema / properties / kinds / items / enum
      Previous value: -[
      -  "inspect_compile_issue",
      -  "break_dependency_cycle",
      -  "canonicalize_graph_arrays",
      -  "resolve_dangling_reference",
      -  "add_missing_relation",
      -  "materialize_external_element",
      -  "unassigned_node",
      -  "empty_domain",
      -  "separate_evidence_from_concept",
      -  "fold_bulk_siblings",
      -  "retire_unearned_node",
      -  "capability_without_evidence",
      -  "rejudge_summary_membership"
      -]New value: +[
      +  "inspect_compile_issue",
      +  "break_dependency_cycle",
      +  "canonicalize_graph_arrays",
      +  "resolve_dangling_reference",
      +  "add_missing_relation",
      +  "materialize_external_element",
      +  "unassigned_node",
      +  "empty_domain",
      +  "separate_evidence_from_concept",
      +  "fold_bulk_siblings",
      +  "retire_unearned_node",
      +  "capability_without_evidence",
      +  "rejudge_summary_membership",
      +  "definition_missing",
      +  "boundary_missing",
      +  "epistemic_exclusion",
      +  "folder_only_evidence",
      +  "slug_outside_kind_folder",
      +  "uncertainty_missing",
      +  "retire_starter_example"
      +]
    • changedInput schema / properties / kinds / maxItems
      Previous value: -13New value: +20
  3. First observedv0.13.0

TDQS

A4.2/5.0
Behavior4/5

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

With readOnlyHint=true and destructiveHint=false already in annotations, the description adds meaningful context beyond safety: archive records are immutable, 'not approved ontology facts,' reviews are joined to exact run/finding ids, pagination should be followed even when a page is empty, task text is never persisted, and several operations are side-effect-free. It does repeat 'side effect 0' from annotations, but the amount of non-redundant operational behavior disclosed is substantial.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sprawling block that opens with archive details rather than the primary purpose, then runs through a dense catalog of every operation. Many clauses are necessary for a 39-operation tool, but the total is poorly front-loaded and lacks structural markers, making it harder to scan than it needs to be.

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 high-complexity operation-based tool with an output schema, the description covers the full operation set, usage constraints, behavioral caveats, and write guards. Since output schema exists, return values need not be explained, and the description's remaining details are sufficient for an agent to call the tool correctly.

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?

Schema description coverage is 100%, so the schema already documents all 57 parameters in detail. The description adds operation-level usage context (e.g. analysisMode/project/limit/analysisCursor for analysis_history, recordId for analysis_record, task limits for agent_brief compact), but does not meaningfully extend the per-parameter semantics beyond what the schema provides. Baseline 3 is appropriate when the structured schema carries the parameter documentation.

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 ('Run graph-engine queries') and resource ('freshly compiled ontology artifact') and enumerates all 39 operations. It explicitly distinguishes itself from compile_ontology by saying 'without pulling the full compile_ontology payload' and from non-graph read operations like read_source. An agent can tell what this tool is for and what it is not for without opening 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 Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit when-to-use guidance: 'Use this when you need graph-database-like answers without pulling the full compile_ontology payload.' It names alternatives and constraints, e.g. 'For impact and blast_radius, only declared depends_on is allowed; use reachability/subgraph for structure' and 'do not precede it with workspace_brief or a full inventory unless the question needs whole-vault health.' Operation-level routing is also specified, such as relation_check as a preflight before add_relation.

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