get_company_officers
Retrieve all current and historical officers of a company, including their positions and service dates, by providing jurisdiction code and company number.
Instructions
Get all officers for a specific company. Returns current and historical officers with positions and dates.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| jurisdiction_code | Yes | Jurisdiction code (e.g. 'us_de', 'gb', 'de') | |
| company_number | Yes | Company registration number | |
| page | No | Page number for pagination (default 1) |
Implementation Reference
- src/index.ts:77-81 (schema)TypeScript interface defining input arguments for get_company_officers: jurisdiction_code (string), company_number (string), and optional page (number).
interface GetCompanyOfficersArgs { jurisdiction_code: string; company_number: string; page?: number; } - src/index.ts:149-168 (registration)Tool registration/definition in the ListToolsRequestSchema handler, including the name 'get_company_officers', description, and input JSON schema.
{ name: "get_company_officers", description: "Get all officers for a specific company. Returns current and historical officers with positions and dates.", inputSchema: { type: "object", properties: { jurisdiction_code: { type: "string", description: "Jurisdiction code (e.g. 'us_de', 'gb', 'de')", }, company_number: { type: "string", description: "Company registration number", }, page: { type: "number", description: "Page number for pagination (default 1)" }, }, required: ["jurisdiction_code", "company_number"], }, }, - src/index.ts:303-328 (handler)Handler implementation: extracts args, validates required fields, calls the OpenCorporates API at /companies/{jurisdiction_code}/{company_number}/officers, maps officer data to output, and returns results as JSON text.
case "get_company_officers": { const { jurisdiction_code, company_number, page } = args as unknown as GetCompanyOfficersArgs; if (!jurisdiction_code || !company_number) throw new Error("Parameters 'jurisdiction_code' and 'company_number' are required"); const data = (await apiFetch( `/companies/${jurisdiction_code}/${encodeURIComponent(company_number)}/officers`, { page } )) as { results: { officers: Array<{ officer: Record<string, unknown> }> } }; const officers = data.results?.officers ?? []; if (officers.length === 0) return textResult("No officers found for this company."); const out = officers.map(({ officer: o }) => ({ name: o["name"], position: o["position"], uid: o["uid"], start_date: o["start_date"], end_date: o["end_date"], inactive: o["inactive"], nationality: o["nationality"], occupation: o["occupation"], opencorporates_url: o["opencorporates_url"], })); return textResult(JSON.stringify(out, null, 2)); }