Skip to main content
Glama

sim_query

Destructive

Answer a question over the edge graph between stored models: bounded paths, closure over transitive predicates, and conjunctive patterns of up to 4 triples joined on shared ?variables. The query argument is JSON: {"select": ["?m"], "where": [{"subject": "?m", "predicate": "subnetOf", "object": "", "mode": "closure"}, {"subject": "?m", "predicate": "@type", "object": "QueueingSystem"}]}; a term starting with ? is a variable, anything else a constant (a 24-hex content id, or for @type's object a model kind). Modes: edge (default; one stored edge, read through the registry: narrower is read as broader turned round, symmetric predicates match either way round), path (1..maxHops hops, maxHops 1 to 8 required; a row says reached by a path unless the predicate is transitive), closure (no maxHops; allowed only on the transitive predicates broader, isomorphicTo, migratedFrom, narrower, subnetOf, supersededBy). Put the bound term in object to walk backwards. Unregistered (legacy) predicates are one stored edge in their stored direction only, never walked or closed over. A structural edge (isomorphicTo, subnetOf, preservesInvariant, refines) counts only when one of its stored witnesses re-checks valid now; a derived structural fact carries a derivation (the chain of witnesses and the composed map's digest) that sim_check_witness(derivation=…) re-checks, and is never stored; excluded lists the edges not walked and why. Closure runs per predicate (isomorphicTo hops never feed a subnetOf closure). status complete means complete over the eligible edges (and, for path, within maxHops: hopLimitReached names patterns with edges beyond); truncated means a bound was reached, rows is absent and the rows found so far are in partialRows (true, but not all of them). A query with no variables answers yes, no or unknown (a bound stopped it, or a stored row could not be decoded); a no's caveat says how far the search looked (only closure rules out a derived edge, and a path cut at maxHops says so), and no is not a refutation. Pattern numbers in a result (support[].pattern, hopLimitReached, unmatched, truncated.pattern) are 0-based positions in query.normalized.where; refusals number your patterns from 1. Limits: 4 patterns, 8 hops, 200 rows, 10,000 intermediate rows, 1,000,000 work units, 64 models probed, a 256 KiB result, a 16 KiB query; the whole call is bounded by the 55s request limit. Over a limit before running is a refusal naming it; reached while running is truncated, and retrying gives the same answer. Needs sign-in with read scope (opens OAuth the first time). Costs 2 compute tokens per call, cache hits and refusals included. Writes one Query and one Result entity, content-addressed (resolve either at GET /api/lineage/{id}; stored is false, with storedNote saying why, if the write failed or a composed map was refused); a repeated question is served from the cache only while the edges and witnesses it read, and the models it checked, are unchanged. An answer naming models that have since been superseded carries superseded ([{model, successor, current, chainStatus}]); the answer is still right about those versions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesthe query as JSON: {"select": [variables], "where": [{"subject", "predicate", "object", "mode", "maxHops"}]}

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior5/5

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

Annotations (readOnlyHint=false, destructiveHint=true, openWorldHint=true, idempotentHint=false) are consistent with a tool that writes Query and Result entities, and the description adds substantial context beyond them: sign-in with read scope, 2 compute-token cost, cache invalidation rules, hard limits, refusal-vs-truncation semantics, and how derived structural facts are never stored. This is far richer behavioral disclosure than the annotations alone provide.

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

Conciseness3/5

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

The purpose is correctly front-loaded in the first sentence, and most sentences carry load-bearing detail. But it is a single monolithic paragraph with no headings or line breaks, cramming query grammar, semantics, limits, auth, cost, and result fields together, which makes it hard to scan and slows an agent parsing it.

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?

With no output schema and a highly complex tool, the description compensates by explaining result fields (status, partialRows, rows, excluded, superseded, support[].pattern, refusals), the limits that trigger refusal vs truncation, auth/cost, and persistence effects. Nothing essential for correct invocation is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although the schema already nominally covers the single query parameter, its description is a bare JSON sketch; the tool description fully specifies the grammar (?variables vs constants, 24-hex ids, model kinds), modes, maxHops ranges, which predicates allow closure, backwards walking via object, and legacy-predicate behavior. It adds meaning far beyond 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 and resource: 'Answer a question over the edge graph between stored models', immediately qualified by the three query modes (bounded paths, closure, conjunctive patterns). An agent can distinguish this from graph-walking siblings like sim_reach, sim_neighbors, and sim_edges without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

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

Usage is implied by the mode semantics (edge vs path vs closure, and when closure is permitted) and it cross-references sim_check_witness for re-checking derivations. However, it never explicitly says when to choose this tool over siblings such as sim_neighbors, sim_reach, or sim_edges, nor states exclusions. Adequate but with a real routing gap.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources