fetch_company
Retrieve LinkedIn company details, including employees, posts, and decision makers, using a company URL. Customize data retrieval with filters and optional configurations for targeted insights.
Instructions
Allows you to open a company page to retrieve its basic information (st.openCompanyPage action). Can optionally retrieve employees, posts and decision makers.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| companyUrl | Yes | Public or hashed LinkedIn URL of the company. (e.g., 'https://www.linkedin.com/company/microsoft') | |
| dmRetrievalConfig | No | Optional. Configuration for retrieving decision makers. Available only if retrieveDMs is true. | |
| employeeRetrievalConfig | No | Optional. Configuration for retrieving employees. Available only if retrieveEmployees is true. | |
| postRetrievalConfig | No | Optional. Configuration for retrieving posts. Available only if retrievePosts is true. | |
| retrieveDMs | No | Optional. Whether to retrieve the company's decision makers information. Default is false. | |
| retrieveEmployees | No | Optional. Whether to retrieve the company's employees information. Default is false. | |
| retrievePosts | No | Optional. Whether to retrieve the company's posts information. Default is false. |
Input Schema (JSON Schema)
{
"properties": {
"companyUrl": {
"description": "Public or hashed LinkedIn URL of the company. (e.g., 'https://www.linkedin.com/company/microsoft')",
"type": "string"
},
"dmRetrievalConfig": {
"description": "Optional. Configuration for retrieving decision makers. Available only if retrieveDMs is true.",
"properties": {
"limit": {
"description": "Optional. Number of decision makers to retrieve. Defaults to 20, with a maximum value of 20. If a company has fewer decision makers than specified, only the available ones will be returned.",
"type": "number"
}
},
"type": "object"
},
"employeeRetrievalConfig": {
"description": "Optional. Configuration for retrieving employees. Available only if retrieveEmployees is true.",
"properties": {
"filter": {
"description": "Optional. Object that specifies filtering criteria for employees. When multiple filter fields are specified, they are combined using AND logic.",
"properties": {
"firstName": {
"description": "Optional. First name of employee.",
"type": "string"
},
"industries": {
"description": "Optional. Array of enums representing industries. Matches if employee works in any of the listed industries. Takes specific values available in the LinkedIn interface.",
"type": "array"
},
"lastName": {
"description": "Optional. Last name of employee.",
"type": "string"
},
"locations": {
"description": "Optional. Array of free-form strings representing locations. Matches if employee is located in any of the listed locations.",
"type": "array"
},
"position": {
"description": "Optional. Job position of employee.",
"type": "string"
},
"schools": {
"description": "Optional. Array of institution names. Matches if employee currently attends or previously attended any of the listed institutions.",
"type": "array"
}
},
"type": "object"
},
"limit": {
"description": "Optional. Maximum number of employees to retrieve. Defaults to 500, with a maximum value of 500.",
"type": "number"
}
},
"type": "object"
},
"postRetrievalConfig": {
"description": "Optional. Configuration for retrieving posts. Available only if retrievePosts is true.",
"properties": {
"limit": {
"description": "Optional. Number of posts to retrieve. Defaults to 20, with a maximum value of 20.",
"type": "number"
},
"since": {
"description": "Optional. ISO 8601 timestamp to filter posts published after the specified time.",
"type": "string"
}
},
"type": "object"
},
"retrieveDMs": {
"description": "Optional. Whether to retrieve the company's decision makers information. Default is false.",
"type": "boolean"
},
"retrieveEmployees": {
"description": "Optional. Whether to retrieve the company's employees information. Default is false.",
"type": "boolean"
},
"retrievePosts": {
"description": "Optional. Whether to retrieve the company's posts information. Default is false.",
"type": "boolean"
}
},
"required": [
"companyUrl"
],
"type": "object"
}
Implementation Reference
- src/tools/fetch-company.ts:7-154 (handler)Core implementation of the 'fetch_company' tool as FetchCompanyTool class extending OperationTool. Defines name, operationName (fetchCompany from linkedapi-node), Zod input schema, and MCP Tool metadata via getTool().export class FetchCompanyTool extends OperationTool<TFetchCompanyParams, unknown> { public override readonly name = 'fetch_company'; public override readonly operationName = OPERATION_NAME.fetchCompany; protected override readonly schema = z.object({ companyUrl: z.string(), retrieveEmployees: z.boolean().optional().default(false), retrievePosts: z.boolean().optional().default(false), retrieveDMs: z.boolean().optional().default(false), postRetrievalConfig: z .object({ limit: z.number().min(1).max(20).optional(), since: z.string().optional(), }) .optional(), dmRetrievalConfig: z .object({ limit: z.number().min(1).max(20).optional(), }) .optional(), employeeRetrievalConfig: z .object({ limit: z.number().min(1).max(500).optional(), filter: z .object({ firstName: z.string().optional(), lastName: z.string().optional(), position: z.string().optional(), locations: z.array(z.string()).optional(), industries: z.array(z.string()).optional(), schools: z.array(z.string()).optional(), }) .optional(), }) .optional(), }); public override getTool(): Tool { return { name: this.name, description: 'Allows you to open a company page to retrieve its basic information (st.openCompanyPage action). Can optionally retrieve employees, posts and decision makers.', inputSchema: { type: 'object', properties: { companyUrl: { type: 'string', description: "Public or hashed LinkedIn URL of the company. (e.g., 'https://www.linkedin.com/company/microsoft')", }, retrieveEmployees: { type: 'boolean', description: "Optional. Whether to retrieve the company's employees information. Default is false.", }, retrievePosts: { type: 'boolean', description: "Optional. Whether to retrieve the company's posts information. Default is false.", }, retrieveDMs: { type: 'boolean', description: "Optional. Whether to retrieve the company's decision makers information. Default is false.", }, postRetrievalConfig: { type: 'object', description: 'Optional. Configuration for retrieving posts. Available only if retrievePosts is true.', properties: { limit: { type: 'number', description: 'Optional. Number of posts to retrieve. Defaults to 20, with a maximum value of 20.', }, since: { type: 'string', description: 'Optional. ISO 8601 timestamp to filter posts published after the specified time.', }, }, }, dmRetrievalConfig: { type: 'object', description: 'Optional. Configuration for retrieving decision makers. Available only if retrieveDMs is true.', properties: { limit: { type: 'number', description: 'Optional. Number of decision makers to retrieve. Defaults to 20, with a maximum value of 20. If a company has fewer decision makers than specified, only the available ones will be returned.', }, }, }, employeeRetrievalConfig: { type: 'object', description: 'Optional. Configuration for retrieving employees. Available only if retrieveEmployees is true.', properties: { limit: { type: 'number', description: 'Optional. Maximum number of employees to retrieve. Defaults to 500, with a maximum value of 500.', }, filter: { type: 'object', description: 'Optional. Object that specifies filtering criteria for employees. When multiple filter fields are specified, they are combined using AND logic.', properties: { firstName: { type: 'string', description: 'Optional. First name of employee.', }, lastName: { type: 'string', description: 'Optional. Last name of employee.', }, position: { type: 'string', description: 'Optional. Job position of employee.', }, locations: { type: 'array', description: 'Optional. Array of free-form strings representing locations. Matches if employee is located in any of the listed locations.', items: { type: 'string' }, }, industries: { type: 'array', description: 'Optional. Array of enums representing industries. Matches if employee works in any of the listed industries. Takes specific values available in the LinkedIn interface.', items: { type: 'string' }, }, schools: { type: 'array', description: 'Optional. Array of institution names. Matches if employee currently attends or previously attended any of the listed institutions.', items: { type: 'string' }, }, }, }, }, }, }, required: ['companyUrl'], }, }; } }
- src/linked-api-tools.ts:4-46 (registration)Registration of the fetch_company tool: imported and instantiated in LinkedApiTools constructor, added to the tools array.import { FetchCompanyTool } from './tools/fetch-company.js'; import { FetchPersonTool } from './tools/fetch-person.js'; import { FetchPostTool } from './tools/fetch-post.js'; import { GetApiUsageTool } from './tools/get-api-usage-stats.js'; import { GetConversationTool } from './tools/get-conversation.js'; import { GetWorkflowResultTool } from './tools/get-workflow-result.js'; import { NvFetchCompanyTool } from './tools/nv-fetch-company.js'; import { NvFetchPersonTool } from './tools/nv-fetch-person.js'; import { NvGetConversationTool } from './tools/nv-get-conversation.js'; import { NvSearchCompaniesTool } from './tools/nv-search-companies.js'; import { NvSearchPeopleTool } from './tools/nv-search-people.js'; import { NvSendMessageTool } from './tools/nv-send-message.js'; import { ReactToPostTool } from './tools/react-to-post.js'; import { RemoveConnectionTool } from './tools/remove-connection.js'; import { RetrieveConnectionsTool } from './tools/retrieve-connections.js'; import { RetrievePendingRequestsTool } from './tools/retrieve-pending-requests.js'; import { RetrievePerformanceTool } from './tools/retrieve-performance.js'; import { RetrieveSSITool } from './tools/retrieve-ssi.js'; import { SearchCompaniesTool } from './tools/search-companies.js'; import { SearchPeopleTool } from './tools/search-people.js'; import { SendConnectionRequestTool } from './tools/send-connection-request.js'; import { SendMessageTool } from './tools/send-message.js'; import { WithdrawConnectionRequestTool } from './tools/withdraw-connection-request.js'; import { LinkedApiTool } from './utils/linked-api-tool.js'; import { LinkedApiProgressNotification } from './utils/types.js'; export class LinkedApiTools { public readonly tools: ReadonlyArray<LinkedApiTool<unknown, unknown>>; 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),
- src/tools/fetch-company.ts:10-41 (schema)Zod schema for validating input parameters to the fetch_company tool.protected override readonly schema = z.object({ companyUrl: z.string(), retrieveEmployees: z.boolean().optional().default(false), retrievePosts: z.boolean().optional().default(false), retrieveDMs: z.boolean().optional().default(false), postRetrievalConfig: z .object({ limit: z.number().min(1).max(20).optional(), since: z.string().optional(), }) .optional(), dmRetrievalConfig: z .object({ limit: z.number().min(1).max(20).optional(), }) .optional(), employeeRetrievalConfig: z .object({ limit: z.number().min(1).max(500).optional(), filter: z .object({ firstName: z.string().optional(), lastName: z.string().optional(), position: z.string().optional(), locations: z.array(z.string()).optional(), industries: z.array(z.string()).optional(), schools: z.array(z.string()).optional(), }) .optional(), }) .optional(), });
- src/utils/linked-api-tool.ts:36-58 (handler)Handler execution logic in OperationTool base class: resolves the specific operation by operationName and executes it with progress tracking.export abstract class OperationTool<TParams, TResult> extends LinkedApiTool<TParams, TResult> { public abstract readonly operationName: TOperationName; 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, }); } }