search_entities
Search for companies, people, and patents in the financial knowledge graph by name, ticker, or keyword. Filter results by type, sector, or limit.
Instructions
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')
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query (name, ticker, or keyword) | |
| entity_type | No | Filter by type | |
| sector | No | Filter by sector: semiconductors, software, pharma, etc. | |
| limit | No | Max results (default 20) |
Implementation Reference
- graphite_mcp/server.py:50-62 (schema)Tool definition (schema) for search_entities: defines name, description, and inputSchema with 'query' (required), 'entity_type', 'sector', and 'limit' (optional) parameters.
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"], }, - graphite_mcp/server.py:50-63 (registration)Registration: search_entities is included as a Tool in the list returned by the @server.list_tools() handler, making it available to MCP clients.
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"], }, ), - graphite_mcp/server.py:145-151 (handler)Handler: when the tool name is 'search_entities', it calls the central REST API endpoint /api/v1/search with the query, entity_type, sector, and limit parameters.
if name == "search_entities": result = await _get("/search", params={ "q": arguments["query"], "type": arguments.get("entity_type"), "sector": arguments.get("sector"), "limit": arguments.get("limit", 20), }) - graphite_mcp/server.py:38-42 (helper)Helper function _get: used by the search_entities handler to make the actual HTTP GET request to the central server.
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()