Skip to main content
Glama

graph_search

Read-onlyIdempotent

Query entity relationships with graph algorithms to traverse connections, find shortest paths, extract subgraphs or ego networks, and compute graph statistics by entity code.

Instructions

Perform graph-based entity relationship queries using NetworkX.

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": {
      "algorithm": "<algorithm>",
      "start_entity_code": "<start_entity_code>"
    },
    "name": "graph_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
algorithmYesGraph algorithm to use. Options: - "bfs": Breadth-first search traversal - "dfs": Depth-first search traversal - "neighbors": Get direct neighbors - "shortest_path": Find shortest path between two entities - "subgraph": Extract subgraph by entity type - "ego_graph": Extract ego graph centered on entity - "statistics": Get graph statistics
max_depthNoMaximum traversal depth (default: 3)
end_entity_codeNoEnding entity code (required for shortest_path)
start_entity_codeYesStarting entity code (e.g., "AAPL", "CN")
entity_type_filterNoFilter results by entity type (e.g., "country", "stock")

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false and openWorldHint=false, so the safety profile is fully covered structurally. The description adds only the implementation detail 'using NetworkX', which is not behaviorally actionable; it says nothing about traversal cost, result size, or how max_depth bounds output.

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?

A single front-loaded sentence with no filler or repetition. It is efficient, though its brevity leaves the tool under-explained rather than over-worded.

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

Completeness2/5

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

This is a complex tool exposing seven traversal algorithms with depth parameters, yet the description never explains what each mode yields or how to pick one. The output schema and 100% parameter coverage offset some of that, but for a multi-algorithm graph tool the description is too thin to guide correct invocation.

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%, with the algorithm enum, defaults, and the shortest_path dependency on end_entity_code all documented inline. The description adds no meaning beyond the schema, so the baseline 3 applies.

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 resource ('graph-based entity relationship queries') and names the underlying mechanism (NetworkX), so the agent knows this is structural traversal rather than text search. It does not distinguish itself from siblings such as semantic_search_entities or list_relationships, which operate on the same entity/relationship domain.

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

Usage Guidelines2/5

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

There is no guidance on when to choose graph traversal over the sibling search or list tools, nor any prerequisites such as needing entities to be bound first. The only usage signal comes from the schema (e.g., end_entity_code required for shortest_path), not the description.

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