find_path
Find the relationship chain connecting two companies or entities in the financial knowledge graph, showing intermediate connections up to a specified depth.
Instructions
Find how two companies/entities are connected through the knowledge graph. Shows the chain of relationships. Example: find_path(source='company:AAPL', target='company:TSM')
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | Source entity ID | |
| target | Yes | Target entity ID | |
| max_depth | No | Max hops (default 6) |
Implementation Reference
- graphite_mcp/server.py:97-109 (schema)Input schema for the 'find_path' tool: requires source and target entity IDs, with optional max_depth (default 6).
Tool( name="find_path", description="Find how two companies/entities are connected through the knowledge graph. Shows the chain of relationships. Example: find_path(source='company:AAPL', target='company:TSM')", inputSchema={ "type": "object", "properties": { "source": {"type": "string", "description": "Source entity ID"}, "target": {"type": "string", "description": "Target entity ID"}, "max_depth": {"type": "integer", "description": "Max hops (default 6)", "default": 6}, }, "required": ["source", "target"], }, ), - graphite_mcp/server.py:162-167 (handler)Handler for 'find_path' tool: calls GET /api/v1/graph/path with source, target, and max_depth parameters via the central REST API.
elif name == "find_path": result = await _get("/graph/path", params={ "source": arguments["source"], "target": arguments["target"], "max_depth": arguments.get("max_depth", 6), }) - graphite_mcp/server.py:47-133 (registration)Tool registration: the 'find_path' tool is registered in the list_tools() function (line 98) returned by the @server.list_tools() decorator.
@server.list_tools() async def list_tools() -> list[Tool]: return [ Tool( name="search_entities", description="Search the financial knowledge graph for companies, people, patents by name, ticker, or description. Example: search_entities(query='NVIDIA') or search_entities(query='semiconductor', sector='semiconductors')", inputSchema={ "type": "object", "properties": { "query": {"type": "string", "description": "Search query (name, ticker, or keyword)"}, "entity_type": {"type": "string", "description": "Filter by type", "enum": ["company", "person", "patent", "product", "regulation", "event"]}, "sector": {"type": "string", "description": "Filter by sector: semiconductors, software, pharma, etc."}, "limit": {"type": "integer", "description": "Max results (default 20)", "default": 20}, }, "required": ["query"], }, ), Tool( name="get_entity", description="Get detailed information about a specific entity by ID. Example: get_entity(entity_id='company:NVDA')", inputSchema={ "type": "object", "properties": { "entity_id": {"type": "string", "description": "Entity ID, e.g. 'company:AAPL', 'person:TIM_COOK_AAPL'"}, }, "required": ["entity_id"], }, ), Tool( name="get_relationships", description="Get all relationships for an entity — suppliers, competitors, partners, dependencies, etc. Example: get_relationships(entity_id='company:NVDA')", inputSchema={ "type": "object", "properties": { "entity_id": {"type": "string", "description": "Entity ID"}, }, "required": ["entity_id"], }, ), Tool( name="get_facts", description="Get known facts about an entity — revenue, employee count, etc. Example: get_facts(entity_id='company:AAPL')", inputSchema={ "type": "object", "properties": { "entity_id": {"type": "string", "description": "Entity ID"}, }, "required": ["entity_id"], }, ), Tool( name="find_path", description="Find how two companies/entities are connected through the knowledge graph. Shows the chain of relationships. Example: find_path(source='company:AAPL', target='company:TSM')", inputSchema={ "type": "object", "properties": { "source": {"type": "string", "description": "Source entity ID"}, "target": {"type": "string", "description": "Target entity ID"}, "max_depth": {"type": "integer", "description": "Max hops (default 6)", "default": 6}, }, "required": ["source", "target"], }, ), Tool( name="exposure_analysis", description="Analyze a company's exposure: 1st and 2nd degree connections, sector concentration, dependency risks. Example: exposure_analysis(entity_id='company:TSM')", inputSchema={ "type": "object", "properties": { "entity_id": {"type": "string", "description": "Entity ID to analyze"}, }, "required": ["entity_id"], }, ), Tool( name="compare_entities", description="Compare two entities: shared connections, direct relationships, path distance. Example: compare_entities(entity_a='company:NVDA', entity_b='company:AMD')", inputSchema={ "type": "object", "properties": { "entity_a": {"type": "string", "description": "First entity ID"}, "entity_b": {"type": "string", "description": "Second entity ID"}, }, "required": ["entity_a", "entity_b"], }, ), ]