get_entity
Retrieve detailed information about a specific financial entity, such as a company or executive, by providing its unique ID from the Graphite Financial Knowledge Graph.
Instructions
Get detailed information about a specific entity by ID. Example: get_entity(entity_id='company:NVDA')
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entity_id | Yes | Entity ID, e.g. 'company:AAPL', 'person:TIM_COOK_AAPL' |
Implementation Reference
- graphite_mcp/server.py:64-74 (schema)Tool schema/definition for 'get_entity' — declares the tool name, description, and inputSchema requiring an entity_id string.
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"], }, ), - graphite_mcp/server.py:47-133 (registration)Registration of the 'get_entity' tool via @server.list_tools() returning a list of Tool objects.
@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"], }, ), ] - graphite_mcp/server.py:153-154 (handler)Handler for 'get_entity' — calls the REST API endpoint GET /api/v1/entities/{entity_id} via the _get helper and returns JSON result.
elif name == "get_entity": result = await _get(f"/entities/{arguments['entity_id']}") - graphite_mcp/server.py:38-42 (helper)Helper function _get that performs the async HTTP GET request to the central server, used by the get_entity handler.
async def _get(path: str, params: Optional[dict] = None) -> dict: async with httpx.AsyncClient(timeout=30) as client: resp = await client.get(_url(path), params=params, headers=_headers()) resp.raise_for_status() return resp.json()