Skip to main content
Glama
diplv

companylens-mcp

Search Companies

company_search

Search for companies by name or ticker across US and UK official registries to find verified entity IDs for further corporate data access.

Instructions

Search for companies by name or ticker across US (SEC EDGAR) and UK (Companies House) registries. Returns entity IDs that can be used with other tools. Always start here.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesCompany name or stock ticker (e.g. "Apple", "AAPL", "Rolls Royce")
jurisdictionNoFilter by jurisdiction: us, uk, or allall
limitNoNumber of results

Implementation Reference

  • The async handler function that implements the logic for company_search, including making the API call and formatting the response.
    async ({ query, jurisdiction, limit }) => {
      const params = new URLSearchParams({ q: query, jurisdiction, limit: String(limit) });
      const data = await apiCall(`/v1/company/search?${params}`) as {
        results: Array<{ entityId: string; name: string; jurisdiction: string; identifiers: Record<string, string>; source: string }>;
        total: number;
        agent_hint: string;
      };
    
      const lines = data.results.map((r, i) =>
        `${i + 1}. ${r.name} (${r.jurisdiction.toUpperCase()}) — entity_id: ${r.entityId}`
      );
    
      return {
        content: [{
          type: 'text' as const,
          text: data.results.length
            ? `Found ${data.total} result(s):\n\n${lines.join('\n')}\n\n${data.agent_hint}`
            : `No results found for "${query}". Try a different name or ticker.`,
        }],
      };
    },
  • src/index.ts:23-55 (registration)
    Registration of the 'company_search' tool using server.registerTool, including schema definition and the handler.
    server.registerTool(
      'company_search',
      {
        title: 'Search Companies',
        description: 'Search for companies by name or ticker across US (SEC EDGAR) and UK (Companies House) registries. Returns entity IDs that can be used with other tools. Always start here.',
        inputSchema: z.object({
          query: z.string().describe('Company name or stock ticker (e.g. "Apple", "AAPL", "Rolls Royce")'),
          jurisdiction: z.enum(['us', 'uk', 'all']).default('all').describe('Filter by jurisdiction: us, uk, or all'),
          limit: z.number().int().min(1).max(50).default(10).describe('Number of results'),
        }),
      },
      async ({ query, jurisdiction, limit }) => {
        const params = new URLSearchParams({ q: query, jurisdiction, limit: String(limit) });
        const data = await apiCall(`/v1/company/search?${params}`) as {
          results: Array<{ entityId: string; name: string; jurisdiction: string; identifiers: Record<string, string>; source: string }>;
          total: number;
          agent_hint: string;
        };
    
        const lines = data.results.map((r, i) =>
          `${i + 1}. ${r.name} (${r.jurisdiction.toUpperCase()}) — entity_id: ${r.entityId}`
        );
    
        return {
          content: [{
            type: 'text' as const,
            text: data.results.length
              ? `Found ${data.total} result(s):\n\n${lines.join('\n')}\n\n${data.agent_hint}`
              : `No results found for "${query}". Try a different name or ticker.`,
          }],
        };
      },
    );
  • The zod input schema definition for the 'company_search' tool.
    inputSchema: z.object({
      query: z.string().describe('Company name or stock ticker (e.g. "Apple", "AAPL", "Rolls Royce")'),
      jurisdiction: z.enum(['us', 'uk', 'all']).default('all').describe('Filter by jurisdiction: us, uk, or all'),
      limit: z.number().int().min(1).max(50).default(10).describe('Number of results'),
    }),
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses data sources (SEC EDGAR, Companies House) and return behavior (entity IDs for chaining), but lacks safety profile confirmation (read-only status), rate limits, or error handling details.

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?

Three sentences each earning their place: core function definition, return value explanation, and workflow positioning. No redundancy or waste; perfectly front-loaded with critical guidance.

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 3-parameter search tool with complete schema coverage, the description adequately compensates for missing output schema by explaining return values (entity IDs) and provides essential workflow context. Lacks detailed return structure specification but sufficient for correct tool selection and invocation.

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%, establishing baseline 3. The description references 'name or ticker' and 'US/UK registries' which reinforces the query and jurisdiction parameters, but adds no syntax details or constraints beyond what the schema already provides.

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?

Specific verb 'Search' and resource 'companies' with clear scope (name/ticker across US SEC EDGAR and UK Companies House registries). Distinguishes from sibling detail tools (profile, contracts, etc.) by identifying this as the broad registry search function.

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

Usage Guidelines5/5

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

Explicit workflow guidance 'Always start here' clearly positions this as the entry point before using sibling tools. Also explains it returns 'entity IDs that can be used with other tools', establishing the dependency chain with company_profile and other detail tools.

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/diplv/companylens-mcp'

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