Skip to main content
Glama

search_companies

Search for companies using specific keywords, filters for size, location, and industry, and control the number of results returned. Ideal for targeted lead generation and market analysis.

Instructions

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

Input Schema

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

Implementation Reference

  • The SearchCompaniesTool class is the core handler for the 'search_companies' MCP tool. It extends OperationTool, sets the name and operationName, defines Zod input validation schema, and provides the MCP tool definition including JSON input schema.
    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' }, }, }, }, }, }, }; } }
  • The LinkedApiTools constructor instantiates and registers the SearchCompaniesTool (line 44) among other tools in the tools array, making it available for use.
    constructor(progressCallback: (progress: LinkedApiProgressNotification) => void) { this.tools = [ // Standard tools new SendMessageTool(progressCallback), new GetConversationTool(progressCallback), new CheckConnectionStatusTool(progressCallback), new RetrieveConnectionsTool(progressCallback), new SendConnectionRequestTool(progressCallback), new WithdrawConnectionRequestTool(progressCallback), new RetrievePendingRequestsTool(progressCallback), new RemoveConnectionTool(progressCallback), new SearchCompaniesTool(progressCallback), new SearchPeopleTool(progressCallback), new FetchCompanyTool(progressCallback), new FetchPersonTool(progressCallback), new FetchPostTool(progressCallback), new ReactToPostTool(progressCallback), new CommentOnPostTool(progressCallback), new RetrieveSSITool(progressCallback), new RetrievePerformanceTool(progressCallback), // Sales Navigator tools new NvSendMessageTool(progressCallback), new NvGetConversationTool(progressCallback), new NvSearchCompaniesTool(progressCallback), new NvSearchPeopleTool(progressCallback), new NvFetchCompanyTool(progressCallback), new NvFetchPersonTool(progressCallback), // Other tools new ExecuteCustomWorkflowTool(progressCallback), new GetWorkflowResultTool(progressCallback), new GetApiUsageTool(progressCallback), ]; }
  • Zod schema for input validation of the search_companies tool parameters.
    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(), });

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