Skip to main content
Glama
Gonzih

mcp-opencorporates

by Gonzih

get_company

Retrieve complete company details including name, status, incorporation date, registered address, officers, and filings by providing a jurisdiction code and company number.

Instructions

Get full details for a specific company by jurisdiction code and company number. Returns name, status, incorporation date, registered address, officers, and filings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jurisdiction_codeYesJurisdiction code (e.g. 'us_de', 'gb', 'de')
company_numberYesCompany registration number

Implementation Reference

  • TypeScript interface defining the input args for the get_company tool: jurisdiction_code and company_number, both strings.
    interface GetCompanyArgs {
      jurisdiction_code: string;
      company_number: string;
    }
  • src/index.ts:113-131 (registration)
    Tool registration in ListToolsRequestSchema handler: defines tool name 'get_company', description, and input JSON schema specifying required jurisdiction_code and company_number.
    {
      name: "get_company",
      description:
        "Get full details for a specific company by jurisdiction code and company number. Returns name, status, incorporation date, registered address, officers, and filings.",
      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",
          },
        },
        required: ["jurisdiction_code", "company_number"],
      },
    },
  • Tool handler for 'get_company' in the CallToolRequestSchema switch statement. Fetches company details from OpenCorporates API via /companies/{jurisdiction_code}/{company_number}, extracts and formats company info including officers (up to 20) and recent filings (up to 5).
    case "get_company": {
      const { jurisdiction_code, company_number } = args as unknown as GetCompanyArgs;
      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)}`
      )) as { results: { company: Record<string, unknown> } };
    
      const c = data.results?.company;
      if (!c) return textResult("Company not found.");
    
      const officers =
        (c["officers"] as Array<{ officer: Record<string, unknown> }> | undefined) ?? [];
      const filings =
        (c["filings"] as Array<{ filing: Record<string, unknown> }> | undefined) ?? [];
    
      const out = {
        name: c["name"],
        company_number: c["company_number"],
        jurisdiction_code: c["jurisdiction_code"],
        status: c["current_status"],
        company_type: c["company_type"],
        incorporation_date: c["incorporation_date"],
        dissolution_date: c["dissolution_date"],
        registered_address: formatAddress(c["registered_address"]),
        agent_name: c["agent_name"],
        agent_address: c["agent_address"],
        opencorporates_url: c["opencorporates_url"],
        officers: officers.slice(0, 20).map(({ officer: o }) => ({
          name: o["name"],
          position: o["position"],
          start_date: o["start_date"],
          end_date: o["end_date"],
          inactive: o["inactive"],
        })),
        filings_count: filings.length,
        recent_filings: filings.slice(0, 5).map(({ filing: f }) => ({
          title: f["title"],
          date: f["date"],
          filing_type: f["filing_type"],
        })),
      };
      return textResult(JSON.stringify(out, null, 2));
    }
  • Helper buildUrl function that constructs API URLs with optional API key and query parameters - used by the handler to build the request URL.
    function buildUrl(
      path: string,
      params: Record<string, string | number | undefined> = {}
    ): string {
      const url = new URL(`${BASE_URL}${path}`);
      if (API_KEY) {
        url.searchParams.set("api_token", API_KEY);
      }
      for (const [key, value] of Object.entries(params)) {
        if (value !== undefined && String(value) !== "") {
          url.searchParams.set(key, String(value));
        }
      }
      return url.toString();
    }
  • Helper apiFetch function that performs HTTP requests to the OpenCorporates API and handles error responses - used by the handler to fetch company data.
    async function apiFetch(
      path: string,
      params: Record<string, string | number | undefined> = {}
    ): Promise<unknown> {
      const url = buildUrl(path, params);
      const response = await fetch(url, {
        headers: {
          "Accept": "application/json",
          "User-Agent": "cc-suite/1.0 (gonzih@gmail.com; +https://github.com/Gonzih/mcp-opencorporates)",
        },
      });
      if (!response.ok) {
        const body = await response.text().catch(() => "");
        throw new Error(
          `OpenCorporates API error ${response.status}: ${body.slice(0, 200)}`
        );
      }
      return response.json();
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses that the tool returns company details (name, status, etc.) which implies a read operation. However, it does not explicitly state read-only, authentication needs, or potential limitations. The listed return fields add moderate transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with action and resource, followed by return fields. No extraneous information. Every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 2 well-defined parameters (100% schema coverage), no output schema, and no annotations, the description provides essential information: purpose, required identifiers, and typical return fields. It could mention error handling or potential missing data, but the information is sufficient for a simple tool with clear siblings.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the input schema already documents both parameters well. The tool description echoes the parameter purpose ('by jurisdiction code and company number') but doesn't add new syntax or meaning beyond the schema. The description compensates slightly by linking parameters to the returned data.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and specifies the resource as 'full details for a specific company' with precise identifiers (jurisdiction code and company number). It lists key return fields, distinguishing itself from sibling tools like get_company_filings and get_company_officers which are more focused.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description instructs when to use the tool (by providing jurisdiction_code and company_number). It implicitly differentiates from sibling search tools and sub-detail tools, but doesn't explicitly state alternatives or when not to use it. Overall context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Gonzih/mcp-opencorporates'

If you have feedback or need assistance with the MCP directory API, please join our Discord server