Skip to main content
Glama
Linked-API
by Linked-API

search_companies

Search for companies using keywords, filters for size, location, and industry to find business leads through LinkedIn data.

Instructions

Allows you to search for companies applying various filtering criteria (st.searchCompanies action).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
termNoOptional. Keyword or phrase to search.
limitNoOptional. Number of search results to return. Defaults to 10, with a maximum value of 1000.
filterNoOptional. Object that specifies filtering criteria for companies. When multiple filter fields are specified, they are combined using AND logic.

Implementation Reference

  • Defines the SearchCompaniesTool class, which implements the MCP tool named 'search_companies'. It specifies the name, operationName for the LinkedAPI operation, input schema (Zod and JSON), description, and getTool() method to return the MCP Tool object. Execution is delegated to the parent OperationTool.
    export class SearchCompaniesTool extends OperationTool<TSearchCompaniesParams, unknown> {
      public override readonly name = 'search_companies';
      public override readonly operationName = OPERATION_NAME.searchCompanies;
      protected override readonly schema = z.object({
        term: z.string().optional(),
        limit: z.number().min(1).max(1000).optional(),
        filter: z
          .object({
            locations: z.array(z.string()).optional(),
            industries: z.array(z.string()).optional(),
            sizes: z
              .array(
                z.enum([
                  '1-10',
                  '11-50',
                  '51-200',
                  '201-500',
                  '501-1000',
                  '1001-5000',
                  '5001-10000',
                  '10001+',
                ]),
              )
              .optional(),
          })
          .optional(),
      });
    
      public override getTool(): Tool {
        return {
          name: this.name,
          description:
            'Allows you to search for companies applying various filtering criteria (st.searchCompanies action).',
          inputSchema: {
            type: 'object',
            properties: {
              term: {
                type: 'string',
                description: 'Optional. Keyword or phrase to search.',
              },
              limit: {
                type: 'number',
                description:
                  'Optional. Number of search results to return. Defaults to 10, with a maximum value of 1000.',
              },
              filter: {
                type: 'object',
                description:
                  'Optional. Object that specifies filtering criteria for companies. When multiple filter fields are specified, they are combined using AND logic.',
                properties: {
                  sizes: {
                    type: 'array',
                    description:
                      'Optional. Array of enums representing employee count ranges. Matches if company size falls within any of the listed ranges.',
                    items: {
                      type: 'string',
                      enum: [
                        '1-10',
                        '11-50',
                        '51-200',
                        '201-500',
                        '501-1000',
                        '1001-5000',
                        '5001-10000',
                        '10001+',
                      ],
                    },
                  },
                  locations: {
                    type: 'array',
                    description:
                      'Optional. Array of free-form strings representing locations. Matches if company is headquartered in any of the listed locations.',
                    items: { type: 'string' },
                  },
                  industries: {
                    type: 'array',
                    description:
                      'Optional. Array of enums representing industries. Matches if company works in any of the listed industries. Takes specific values available in the LinkedIn interface.',
                    items: { type: 'string' },
                  },
                },
              },
            },
          },
        };
      }
    }
  • Zod schema defining the input parameters for the search_companies tool: term, limit, and filter (locations, industries, sizes). Used for validation in validate() method.
    protected override readonly schema = z.object({
      term: z.string().optional(),
      limit: z.number().min(1).max(1000).optional(),
      filter: z
        .object({
          locations: z.array(z.string()).optional(),
          industries: z.array(z.string()).optional(),
          sizes: z
            .array(
              z.enum([
                '1-10',
                '11-50',
                '51-200',
                '201-500',
                '501-1000',
                '1001-5000',
                '5001-10000',
                '10001+',
              ]),
            )
            .optional(),
        })
        .optional(),
    });
  • Instantiates the SearchCompaniesTool and adds it to the tools array in LinkedApiTools constructor, registering it for use.
    new SearchCompaniesTool(progressCallback),
  • Imports the SearchCompaniesTool class.
    import { SearchCompaniesTool } from './tools/search-companies.js';
  • The execute method in OperationTool (parent class) implements the core handler logic for all operation-based tools, including search_companies. It locates the specific LinkedAPI operation by name and executes it with progress tracking.
    public override execute({
      linkedapi,
      args,
      workflowTimeout,
      progressToken,
    }: {
      linkedapi: LinkedApi;
      args: TParams;
      workflowTimeout: number;
      progressToken?: string | number;
    }): Promise<TMappedResponse<TResult>> {
      const operation = linkedapi.operations.find(
        (operation) => operation.operationName === this.operationName,
      )! as Operation<TParams, TResult>;
      return executeWithProgress(this.progressCallback, operation, workflowTimeout, {
        params: args,
        progressToken,
      });
    }
Behavior2/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 of behavioral disclosure. It mentions 'applying various filtering criteria' but doesn't describe key behaviors: whether this is a read-only operation, what the output format looks like (no output schema), if there are rate limits, authentication requirements, or how results are ordered. For a search tool with no annotations, this leaves significant gaps.

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

Conciseness4/5

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

The description is a single, efficient sentence that gets straight to the point without unnecessary words. However, the inclusion of 'st.searchCompanies action' adds implementation noise that doesn't aid the agent. Overall, it's appropriately sized but could be more front-loaded with user-relevant information.

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

Completeness2/5

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

Given the complexity (3 parameters with a nested object) and lack of annotations or output schema, the description is insufficient. It doesn't explain what the tool returns, how results are structured, or behavioral aspects like pagination or error handling. For a search tool with filtering capabilities, more context is needed to guide effective use.

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 schema description coverage is 100%, with detailed descriptions for 'term', 'limit', and the nested 'filter' object (including its sub-properties like 'sizes', 'locations', 'industries'). The description adds minimal value beyond the schema, only vaguely referencing 'various filtering criteria'. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

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

Purpose3/5

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

The description states the tool 'allows you to search for companies applying various filtering criteria', which provides a basic purpose (searching companies with filters). However, it's vague about what 'search' means (e.g., by name, industry, etc.) and doesn't distinguish it from sibling tools like 'fetch_company' or 'nv_search_companies'. The mention of 'st.searchCompanies action' is implementation-specific and doesn't clarify the user-facing purpose.

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

Usage Guidelines2/5

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

The description offers no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'fetch_company' (for retrieving specific companies) or 'search_people' (for searching individuals), nor does it provide context on prerequisites or typical use cases. The agent must infer usage from the tool name alone.

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/Linked-API/linkedapi-mcp'

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