Skip to main content
Glama
vdmeu

RegistrumMCP

Get company financials

get_financials

Retrieve structured financial data for UK companies from Companies House filings, including revenue, profit, assets, and equity metrics for current and prior years.

Instructions

Get structured financial data for a UK company, parsed from its iXBRL accounts filed at Companies House. Returns revenue, cost of sales, gross profit, operating profit, net profit, fixed assets, current assets, total equity, net assets, creditors, and average employees for the current and prior reporting year. Also includes accounts type (full/abbreviated/micro/dormant) and a data_quality block indicating which fields were extracted and which were absent from the filing. Cached for 7 days.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
company_numberYesCompanies House company number, e.g. '00445790' for Tesco PLC

Implementation Reference

  • The handler function for get_financials tool that executes the tool logic. It accepts company_number parameter, calls the API endpoint /company/{company_number}/financials, and returns the structured financial data or error message.
    async ({ company_number }) => {
      try {
        const data = await api(`/company/${company_number}/financials`);
        return text(data);
      } catch (e) {
        return err(String(e));
      }
    }
  • Input schema definition for get_financials tool using Zod validation. Defines company_number parameter as a string matching regex pattern ^[A-Z0-9]{1,8}$ (1-8 alphanumeric characters for Companies House numbers).
    inputSchema: {
      company_number: z
        .string()
        .regex(/^[A-Z0-9]{1,8}$/)
        .describe("Companies House company number, e.g. '00445790' for Tesco PLC"),
    },
  • src/server.ts:119-146 (registration)
    Complete tool registration for get_financials including title, description, inputSchema, and handler. Registers the tool with the MCP server to make it available for use.
    server.registerTool(
      "get_financials",
      {
        title: "Get company financials",
        description:
          "Get structured financial data for a UK company, parsed from its iXBRL accounts " +
          "filed at Companies House. Returns revenue, cost of sales, gross profit, operating " +
          "profit, net profit, fixed assets, current assets, total equity, net assets, " +
          "creditors, and average employees for the current and prior reporting year. " +
          "Also includes accounts type (full/abbreviated/micro/dormant) and a data_quality " +
          "block indicating which fields were extracted and which were absent from the filing. " +
          "Cached for 7 days.",
        inputSchema: {
          company_number: z
            .string()
            .regex(/^[A-Z0-9]{1,8}$/)
            .describe("Companies House company number, e.g. '00445790' for Tesco PLC"),
        },
      },
      async ({ company_number }) => {
        try {
          const data = await api(`/company/${company_number}/financials`);
          return text(data);
        } catch (e) {
          return err(String(e));
        }
      }
    );
  • Helper function callApi that handles all API requests to the Registrum API. Validates API key, makes HTTP fetch requests with proper headers, and handles error responses. Used by get_financials handler.
    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();
    }
  • Helper functions text() and err() for formatting tool responses. text() wraps successful API responses as JSON, err() wraps error messages. Used by get_financials handler to return results.
    function text(content: unknown) {
      return {
        content: [{ type: "text" as const, text: JSON.stringify(content, null, 2) }],
      };
    }
    
    function err(message: string) {
      return {
        isError: true as const,
        content: [{ type: "text" as const, text: message }],
      };
    }
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: the tool parses iXBRL accounts, returns specific financial metrics for current and prior years, includes accounts type and data quality information, and mentions caching for 7 days. This covers data source, output structure, and performance characteristics, though it doesn't detail error handling or rate limits.

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?

The description is front-loaded with the core purpose, followed by specific details on returned data, accounts type, data quality, and caching. Every sentence adds value without redundancy, making it efficient and well-structured for an AI agent to understand the tool's scope and behavior.

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?

For a tool with no output schema and no annotations, the description provides strong contextual completeness. It details the returned financial fields, accounts type, data quality block, and caching behavior. However, it doesn't specify the output format (e.g., JSON structure) or potential error scenarios, leaving some gaps for an agent to infer.

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?

The input schema has 100% description coverage, with the company_number parameter well-documented in the schema itself (including pattern and example). The description adds no additional parameter semantics beyond what the schema provides, such as explaining how the company number relates to financial data retrieval. The baseline score of 3 is appropriate given the schema's comprehensive coverage.

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 tool's purpose with specific verbs ('Get structured financial data') and resources ('UK company'), distinguishing it from siblings like get_company (general info), get_directors (people data), get_network (relationships), and search_company (search functionality). It specifies the data source (iXBRL accounts from Companies House) and the type of financial data returned.

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 provides clear context for when to use this tool: to retrieve financial data for UK companies from Companies House filings. It implies usage by specifying the data source and company number parameter, but does not explicitly state when not to use it or name alternatives among siblings (e.g., use get_company for non-financial data).

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/vdmeu/registrum-mcp'

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