Search Companies
company_searchSearch for companies by name or ticker across US and UK official registries to find verified entity IDs for further corporate data access.
Instructions
Search for companies by name or ticker across US (SEC EDGAR) and UK (Companies House) registries. Returns entity IDs that can be used with other tools. Always start here.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Company name or stock ticker (e.g. "Apple", "AAPL", "Rolls Royce") | |
| jurisdiction | No | Filter by jurisdiction: us, uk, or all | all |
| limit | No | Number of results |
Implementation Reference
- src/index.ts:34-54 (handler)The async handler function that implements the logic for company_search, including making the API call and formatting the response.
async ({ query, jurisdiction, limit }) => { const params = new URLSearchParams({ q: query, jurisdiction, limit: String(limit) }); const data = await apiCall(`/v1/company/search?${params}`) as { results: Array<{ entityId: string; name: string; jurisdiction: string; identifiers: Record<string, string>; source: string }>; total: number; agent_hint: string; }; const lines = data.results.map((r, i) => `${i + 1}. ${r.name} (${r.jurisdiction.toUpperCase()}) — entity_id: ${r.entityId}` ); return { content: [{ type: 'text' as const, text: data.results.length ? `Found ${data.total} result(s):\n\n${lines.join('\n')}\n\n${data.agent_hint}` : `No results found for "${query}". Try a different name or ticker.`, }], }; }, - src/index.ts:23-55 (registration)Registration of the 'company_search' tool using server.registerTool, including schema definition and the handler.
server.registerTool( 'company_search', { title: 'Search Companies', description: 'Search for companies by name or ticker across US (SEC EDGAR) and UK (Companies House) registries. Returns entity IDs that can be used with other tools. Always start here.', inputSchema: z.object({ query: z.string().describe('Company name or stock ticker (e.g. "Apple", "AAPL", "Rolls Royce")'), jurisdiction: z.enum(['us', 'uk', 'all']).default('all').describe('Filter by jurisdiction: us, uk, or all'), limit: z.number().int().min(1).max(50).default(10).describe('Number of results'), }), }, async ({ query, jurisdiction, limit }) => { const params = new URLSearchParams({ q: query, jurisdiction, limit: String(limit) }); const data = await apiCall(`/v1/company/search?${params}`) as { results: Array<{ entityId: string; name: string; jurisdiction: string; identifiers: Record<string, string>; source: string }>; total: number; agent_hint: string; }; const lines = data.results.map((r, i) => `${i + 1}. ${r.name} (${r.jurisdiction.toUpperCase()}) — entity_id: ${r.entityId}` ); return { content: [{ type: 'text' as const, text: data.results.length ? `Found ${data.total} result(s):\n\n${lines.join('\n')}\n\n${data.agent_hint}` : `No results found for "${query}". Try a different name or ticker.`, }], }; }, ); - src/index.ts:28-32 (schema)The zod input schema definition for the 'company_search' tool.
inputSchema: z.object({ query: z.string().describe('Company name or stock ticker (e.g. "Apple", "AAPL", "Rolls Royce")'), jurisdiction: z.enum(['us', 'uk', 'all']).default('all').describe('Filter by jurisdiction: us, uk, or all'), limit: z.number().int().min(1).max(50).default(10).describe('Number of results'), }),