Skip to main content
Glama

query_local_graph

Read-only

Look up entities and relationships in a local knowledge graph without LLM calls, returning cited facts with hop-based neighbors. Query by name, alias, or keyword to get sourced answers.

Instructions

Look up facts in a local Nightshift knowledge graph (no LLM call): entities matching entity_or_keyword (exact name/alias, substring, or keyword overlap) and the [subject, RELATION, object] triples around them - hop 1 touches a match, hop 2 touches a neighbour - strongest first, each with evidence (job_id, chunk_index, source file span). Searches the newest graph.json in the output dir unless graph_path names a graph.json or a coordinator output_graph.jsonl (inside the allowed roots).

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": {
      "entity_or_keyword": "<entity_or_keyword>"
    },
    "name": "query_local_graph"
  }
}

Input Schema

NameRequiredDescriptionDefault
hopsNo
limitNo
graph_pathNo
entity_or_keywordYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare readOnlyHint and openWorldHint; the description adds substantive behavior beyond them — the ranking order ('strongest first'), the evidence payload (job_id, chunk_index, source file span), the default graph selection, and a permission boundary ('inside the allowed roots'). These are exactly the cost, ordering, and access constraints an agent cannot infer from the annotations.

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 verb and resource, then matching semantics, then return shape, then path resolution — a sensible information hierarchy with no filler sentences. It is somewhat run-on as a single dense paragraph, but nearly every clause carries new information.

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?

An output schema exists, so return-value documentation is unnecessary, and the description still covers matching modes, hop semantics, ordering, and path/permission constraints. For a 4-parameter read-only lookup, nothing an agent needs in order to call it correctly 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 0%, so the description must carry the load, and it does for three of four parameters: entity_or_keyword (three matching modes), hops (hop 1 touches a match, hop 2 a neighbour), and graph_path (names a graph.json or coordinator output_graph.jsonl, with default fallback). Only 'limit' is left to the schema default, which is a minor omission given the stated strongest-first ordering.

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 ('Look up facts in a local Nightshift knowledge graph') and immediately qualifies the retrieval semantics (exact name/alias, substring, or keyword overlap) plus the returned structure ([subject, RELATION, object] triples, hop 1 vs hop 2). The parenthetical 'no LLM call' and the graph_path resolution note make it unmistakably distinct from ingest_directory_to_graph or dispatch_mapreduce_text.

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?

Implies the use case clearly: cheap, deterministic fact lookup without an LLM call, against the newest graph.json by default or a specific graph.json / coordinator output_graph.jsonl when graph_path is supplied. It does not explicitly name a sibling as an alternative or state when-not to use it (e.g., when to prefer re-ingesting), so it stops short of full routing guidance.

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