graph_search
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
| Name | Required | Description | Default |
|---|---|---|---|
| algorithm | Yes | Graph 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_depth | No | Maximum traversal depth (default: 3) | |
| end_entity_code | No | Ending entity code (required for shortest_path) | |
| start_entity_code | Yes | Starting entity code (e.g., "AAPL", "CN") | |
| entity_type_filter | No | Filter results by entity type (e.g., "country", "stock") |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||