Skip to main content
Glama

BYOKG

Find possible gaps

find_gaps
Read-onlyIdempotent

List patterns in the stored data where an edge might be missing at one node, when the user asks what a term may lack or how complete a neighborhood is. Input: ref (required, as get_node takes it: external id, alt id, IRI, exact name or node_id), namespace_id, relation_types and limit. Returns candidates of two rules over the node's outgoing edges: SIBLING_PATTERN (most siblings under one IS_A parent satisfy a relation to a target the node does not) and TWO_HOP_ONLY (the node reaches a target through several intermediate nodes and no stored edge joins them). A candidate is a pattern, not a fact: report it as such, with the notice the answer carries, and never as a missing truth. Deterministic, read-only, no model call, no embedding, nothing stored; at most 20000 edges a call, truncated beyond. SIBLING_PATTERN needs at least min_share of a group of min_group siblings; TWO_HOP_ONLY needs at least min_support distinct intermediate nodes along one two-step path, neither step transitive. The defaults are global, the same for every room. Satisfied patterns (an edge to the target or to an IS_A descendant, a chain of a transitive relation, an edge an IS_A ancestor holds, a declared inverse) are never candidates, nor are obsolete nodes, the structural types and the card's sequence relations. relation_types limits the candidate relations (SIBLING_PATTERN: the relation; TWO_HOP_ONLY: both steps); satisfaction always reads every relation. The relations the room card declares derived from the data (derived_relations on get_room_overview, a co-occurrence count with its basis) are no step of TWO_HOP_ONLY unless relation_types names them, because almost every pair of nodes is two such edges apart; the answer lists them in derived_relation_types. The ref resolves as in get_node (alt ids, NODE_REF_AMBIGUOUS with its candidates). limit counts the candidates returned, in order; candidates_total counts them all, and limit is the name every tool uses for the size of its answer (top_n is its deprecated alias; passing both is SCHEMA_VALIDATION_FAILED). Without the MCP token it reads the public rooms. Example: {"ref": "CL:0000094", "namespace_id": "obo-cl"}. Added in contract revision 4.8.0. Since contract revision 4.9.0 limit is the name of top_n (kept as a deprecated alias). Since contract revision 4.9.2 the card's derived relations are skipped by TWO_HOP_ONLY unless named in relation_types, and derived_relation_types lists them. The contract revision in force is the one every response repeats in _meta.contract_revision and server_info reports; a revision note (Added in, Since) says when a field or a tool appeared, never which revision is current.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "ref": "<ref>"
    },
    "name": "find_gaps"
  }
}

Input Schema

NameRequiredDescriptionDefault
refYesExternal id, alt id, IRI, exact name or node_id.
limitNoCandidates to return, in order.
top_nNoDeprecated since contract revision 4.9.0: pass limit instead (one name for every answer's size); still accepted.
min_groupNoSIBLING_PATTERN: fewest siblings that make a group.
min_shareNoSIBLING_PATTERN: share of siblings that must satisfy the relation.
min_supportNoTWO_HOP_ONLY: fewest distinct intermediate nodes.
namespace_idNoRoom name; omitted: the default room.
relation_typesNoOnly these candidate relations.

Output Schema

NameRequiredDescriptionDefault
nodeYes
groupsYes
noticeYes
reasonYesWhy there is no candidate: ISOLATED_NODE (no edge at all), NO_GROUP (no sibling group and no two-step path), NO_PATTERN (none passes the thresholds); null with candidates.
scannedYesEdges read.
read_onlyYes
truncatedYesThe scan reached scan_limit: the candidates come from the edges read, and an unread edge could satisfy one.
candidatesYes
generationYes
parametersYes
scan_limitYesEdges one call reads at most (20000).
external_idYes
resolved_byYes
namespace_idYes
candidates_totalYes
derived_relation_typesNoAdded in contract revision 4.9.2. The relations the room card declares derived from the data that this call left out of TWO_HOP_ONLY; one named in relation_types is a step like any other and is not listed here.
transitive_relation_typesYesIS_A, PART_OF and the relations the room states transitive: their chains are implied, never a gap.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Far exceeds the read-only annotations: deterministic, no model call, no embedding, nothing stored, a 20000-edge cap with truncation, global defaults, per-rule thresholds, exclusions (satisfied patterns, obsolete nodes, structural types, sequence relations, derived relations), and unauthenticated access reading only public rooms. It also discloses the NODE_REF_AMBIGUOUS and SCHEMA_VALIDATION_FAILED failure modes.

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?

Purpose and inputs are front-loaded, but the body is a dense wall of clauses that repeats what the schema already documents (limit/top_n alias, min_share, min_support). The closing revision-history block and the meta-explanation of what a revision note means do not help an agent select or invoke the tool and dilute the signal.

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 an 8-parameter analytical tool with an output schema and rich annotations, nothing material is missing: semantics of both rules, candidate definition, exclusion rules, thresholds, limits, auth behavior, and error cases are all covered.

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?

Schema coverage is 100%, so 3 is the floor, but the description adds real meaning: relation_types constrains the relation for SIBLING_PATTERN and both steps for TWO_HOP_ONLY, while satisfaction always reads every relation. It also explains min_group/min_share/min_support in terms of the rules, and the limit/top_n alias with the error if both are passed.

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?

Opens with a specific verb and resource: list patterns in stored data where an edge might be missing at a node. It then names the two detection rules (SIBLING_PATTERN, TWO_HOP_ONLY) and their outputs, which makes it clearly distinguishable from path tools like find_shortest_paths and from get_node.

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 an explicit use case: 'when the user asks what a term may lack or how complete a neighborhood is', plus an example invocation. It also warns how to report results (a pattern, not a fact) and cross-references get_node for ref resolution. It stops short of stating when to prefer a sibling tool instead, so it is clear context rather than full when/when-not routing.

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