Skip to main content
Glama

locus_expand_query

Expands a query using knowledge-graph alias resolution and first-hop neighbors to enrich retrieval with canonical names and related entities.

Instructions

Expand a query using KG alias resolution and first-hop neighbours. If query terms match known entity aliases, their canonical names and related entities are appended to produce a richer query string. Returns original, expanded, added_terms, and entity_matches.

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": {
      "query": "<query>"
    },
    "name": "locus_expand_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYes
store_pathNo.locus
max_expansionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.1

TDQS

B3.2/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It discloses the core mechanism (alias resolution plus first-hop neighbours are appended) and names the four returned fields, which is meaningful given there is no output schema. It omits what happens when no alias matches, whether the KG must already exist or be indexed, and how expansion breadth is bounded.

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?

Two tight sentences with zero filler, front-loaded with the verb and mechanism, followed by the return-value contract. Slightly dense jargon ('first-hop neighbours') but appropriately sized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description partially compensates for the absent output schema by enumerating original, expanded, added_terms, and entity_matches. However, with no annotations and 0% parameter documentation, key operational facts — the role of store_path, the meaning of max_expansions, and failure behavior on no match — are missing for a tool that depends on prior KG state.

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

Parameters2/5

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

Schema description coverage is 0% across three parameters, and the description explains none of them beyond implying what 'query' is. store_path (default '.locus') and max_expansions (default 5) are left entirely opaque, so an agent cannot know that the first selects the knowledge-graph location and the second caps how many terms are added.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and mechanism: 'Expand a query using KG alias resolution and first-hop neighbours', and the second sentence clarifies exactly what gets appended. It does not explicitly contrast with the nearest sibling (locus_kg_match), so an agent must infer which one it wants, but the resource and transformation are unambiguous.

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 only implied — the description suggests this belongs upstream of retrieval/querying by enriching a query string, and gives a conditional ('if query terms match known entity aliases'), but never states when to use this versus locus_kg_match, locus_query_entity, or locus_multi_retrieve, nor any exclusions.

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