Get director network
get_networkMap corporate networks by identifying companies connected through shared directors. Analyze group structures and related party relationships for UK companies.
Instructions
Map the corporate network connected to a UK company via shared directors. Returns all companies connected through shared board members, up to the specified depth. Each connected company includes its name, number, status, and the directors it shares with the focal company. Useful for identifying corporate group structures, related party relationships, and director interlocks.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| company_number | Yes | Companies House company number, e.g. '00445790' for Tesco PLC | |
| depth | No | Traversal depth: 1 = direct connections only, 2 = connections of connections (default 1). Depth 2 can return many results for large companies. |
Implementation Reference
- src/server.ts:201-209 (handler)The handler function for get_network tool. Takes company_number and optional depth parameter, constructs API path, calls the registrum API endpoint /company/{company_number}/network, and returns the network data or error.
async ({ company_number, depth }) => { try { const params = depth ? `?depth=${depth}` : ""; const data = await api(`/company/${company_number}/network${params}`); return text(data); } catch (e) { return err(String(e)); } } - src/server.ts:184-198 (schema)Input schema for get_network tool defining two parameters: company_number (required, must match UK company number format) and depth (optional, 1-2 integer for network traversal depth).
inputSchema: { company_number: z .string() .regex(/^[A-Z0-9]{1,8}$/) .describe("Companies House company number, e.g. '00445790' for Tesco PLC"), depth: z .number() .int() .min(1) .max(2) .optional() .describe( "Traversal depth: 1 = direct connections only, 2 = connections of connections (default 1). " + "Depth 2 can return many results for large companies." ), - src/server.ts:174-210 (registration)Complete registration of get_network tool with MCP server, including metadata (title, description), input schema, and handler function.
server.registerTool( "get_network", { title: "Get director network", description: "Map the corporate network connected to a UK company via shared directors. " + "Returns all companies connected through shared board members, up to the specified " + "depth. Each connected company includes its name, number, status, and the directors " + "it shares with the focal company. Useful for identifying corporate group structures, " + "related party relationships, and director interlocks.", inputSchema: { company_number: z .string() .regex(/^[A-Z0-9]{1,8}$/) .describe("Companies House company number, e.g. '00445790' for Tesco PLC"), depth: z .number() .int() .min(1) .max(2) .optional() .describe( "Traversal depth: 1 = direct connections only, 2 = connections of connections (default 1). " + "Depth 2 can return many results for large companies." ), }, }, async ({ company_number, depth }) => { try { const params = depth ? `?depth=${depth}` : ""; const data = await api(`/company/${company_number}/network${params}`); return text(data); } catch (e) { return err(String(e)); } } ); - src/server.ts:7-25 (helper)Helper function that performs HTTP fetch to registrum API with API key authentication. Used by get_network handler to fetch company network data.
export async function callApi( path: string, apiKey: string, baseUrl: string = API_BASE ): Promise<unknown> { if (!apiKey) { throw new Error( "REGISTRUM_API_KEY is not set. Get a free key at https://registrum.co.uk and set it in your MCP client config." ); } const res = await fetch(`${baseUrl}${path}`, { headers: { "X-API-Key": apiKey }, }); if (!res.ok) { const body = await res.text(); throw new Error(`API error ${res.status}: ${body}`); } return res.json(); }