get_corporate_registry
Retrieve incorporation date, status, jurisdiction, address, and officers for a company from OpenCorporates using its legal name. Covers 140+ jurisdictions worldwide.
Instructions
Look up corporate registry data from OpenCorporates — incorporation date, status, jurisdiction, registered address, and company officers. Covers companies in 140+ jurisdictions worldwide. Use the company's legal name for best results. Note: this may return no results for very new or small private companies.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| company_name | Yes | Company legal name as registered (e.g. 'Stripe, Inc.', 'Alphabet Inc.'). Legal names with suffixes like Inc/Ltd/GmbH produce more accurate results. |
Implementation Reference
- src/index.ts:242-257 (handler)The actual handler for the get_corporate_registry tool. Calls searchOpenCorporates() and returns the result as text content.
async ({ company_name }) => { const result = await searchOpenCorporates( company_name, env.OPENCORPORATES_TOKEN ); return { content: [ { type: "text" as const, text: result ? JSON.stringify(result, null, 2) : `No corporate registry data found for "${company_name}".`, }, ], }; } - src/index.ts:241-241 (schema)Input schema for get_corporate_registry: a single required company_name string parameter.
{ company_name: z.string().describe("Company legal name as registered (e.g. 'Stripe, Inc.', 'Alphabet Inc.'). Legal names with suffixes like Inc/Ltd/GmbH produce more accurate results.") }, - src/index.ts:238-258 (registration)Tool registration via server.tool() in the registerTools function of src/index.ts (the Cloudflare Worker version).
server.tool( "get_corporate_registry", "Look up corporate registry data from OpenCorporates — incorporation date, status, jurisdiction, registered address, and company officers. Covers companies in 140+ jurisdictions worldwide. Use the company's legal name for best results. Note: this may return no results for very new or small private companies.", { company_name: z.string().describe("Company legal name as registered (e.g. 'Stripe, Inc.', 'Alphabet Inc.'). Legal names with suffixes like Inc/Ltd/GmbH produce more accurate results.") }, async ({ company_name }) => { const result = await searchOpenCorporates( company_name, env.OPENCORPORATES_TOKEN ); return { content: [ { type: "text" as const, text: result ? JSON.stringify(result, null, 2) : `No corporate registry data found for "${company_name}".`, }, ], }; } ); - bin/cli.js:97-102 (registration)Tool registration in the CLI (stdio) version. Proxies to the remote server via callRemoteTool.
server.tool( "get_corporate_registry", "Look up corporate registry data from OpenCorporates — incorporation date, status, jurisdiction, registered address, and company officers. Covers companies in 140+ jurisdictions worldwide. Use the company's legal name for best results. Note: this may return no results for very new or small private companies.", { company_name: z.string().describe("Company legal name as registered (e.g. 'Stripe, Inc.', 'Alphabet Inc.'). Legal names with suffixes like Inc/Ltd/GmbH produce more accurate results.") }, async ({ company_name }) => callRemoteTool("get_corporate_registry", { company_name }) ); - src/sources/opencorporates.ts:17-73 (helper)Core helper function that queries the OpenCorporates API for corporate registry data (search endpoint). Returns company info including officers.
export async function searchOpenCorporates( companyName: string, token: string | undefined ): Promise<OpenCorpResult | null> { try { const query = encodeURIComponent(companyName); const tokenParam = token ? `&api_token=${token}` : ""; const resp = await fetch( `https://api.opencorporates.com/v0.4/companies/search?q=${query}&per_page=1${tokenParam}`, { signal: AbortSignal.timeout(8000) } ); if (!resp.ok) return null; const data = (await resp.json()) as { results: { companies: { company: { name: string; company_number: string; jurisdiction_code: string; incorporation_date: string | null; company_type: string | null; current_status: string | null; registered_address_in_full: string | null; officers: { officer: { name: string; position: string | null; }; }[]; }; }[]; }; }; const companies = data.results?.companies; if (!companies || companies.length === 0) return null; const c = companies[0].company; return { companyName: c.name, companyNumber: c.company_number, jurisdiction: c.jurisdiction_code, incorporationDate: c.incorporation_date, companyType: c.company_type, status: c.current_status, registeredAddress: c.registered_address_in_full, officers: (c.officers || []).slice(0, 10).map((o) => ({ name: o.officer.name, position: o.officer.position, })), }; } catch { return null; } }