get_linkedin_google_company
Find LinkedIn company profiles using Google search to quickly identify and retrieve business information based on company names or website domains.
Instructions
Search for LinkedIn companies using Google search. First result is usually the best match.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count_per_keyword | No | Max results per keyword | |
| keywords | Yes | Company keywords for search. For example, company name or company website | |
| timeout | No | Timeout in seconds | |
| with_urn | No | Include URNs in response (increases execution time) |
Implementation Reference
- src/index.ts:671-686 (handler)The handler function that executes the tool logic: prepares request data, calls the AnySite API via makeRequest to the /api/linkedin/google/company endpoint, formats and returns the JSON response or error.async ({ keywords, with_urn, count_per_keyword, timeout }) => { const requestData = { timeout, keywords, with_urn, count_per_keyword }; log(`Starting LinkedIn Google company search for keywords: ${keywords.join(', ')}`); try { const response = await makeRequest(API_CONFIG.ENDPOINTS.LINKEDIN_GOOGLE_COMPANY, requestData); return { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] }; } catch (error) { log("LinkedIn Google company search error:", error); return { content: [{ type: "text", text: `LinkedIn Google company search API error: ${formatError(error)}` }], isError: true }; } }
- src/index.ts:665-670 (schema)Inline Zod schema for input validation of tool parameters: keywords (array), with_urn (bool), count_per_keyword (num), timeout (num).{ keywords: z.array(z.string()).describe("Company search keywords"), with_urn: z.boolean().default(false).describe("Include LinkedIn URN"), count_per_keyword: z.number().default(1).describe("Results per keyword"), timeout: z.number().default(300).describe("Timeout in seconds") },
- src/index.ts:663-687 (registration)MCP tool registration call using server.tool() with name 'get_linkedin_google_company', description, input schema, and handler function."get_linkedin_google_company", "Search company via Google", { keywords: z.array(z.string()).describe("Company search keywords"), with_urn: z.boolean().default(false).describe("Include LinkedIn URN"), count_per_keyword: z.number().default(1).describe("Results per keyword"), timeout: z.number().default(300).describe("Timeout in seconds") }, async ({ keywords, with_urn, count_per_keyword, timeout }) => { const requestData = { timeout, keywords, with_urn, count_per_keyword }; log(`Starting LinkedIn Google company search for keywords: ${keywords.join(', ')}`); try { const response = await makeRequest(API_CONFIG.ENDPOINTS.LINKEDIN_GOOGLE_COMPANY, requestData); return { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] }; } catch (error) { log("LinkedIn Google company search error:", error); return { content: [{ type: "text", text: `LinkedIn Google company search API error: ${formatError(error)}` }], isError: true }; } } );
- src/types.ts:100-105 (schema)TypeScript interface defining the shape of input arguments for the tool, matching the Zod schema.export interface GetLinkedinGoogleCompanyArgs { keywords: string[]; with_urn?: boolean; count_per_keyword?: number; timeout?: number; }
- src/types.ts:597-614 (schema)Type guard/validation function for ensuring input args conform to GetLinkedinGoogleCompanyArgs interface.export function isValidGetLinkedinGoogleCompanyArgs( args: unknown ): args is GetLinkedinGoogleCompanyArgs { if (typeof args !== "object" || args === null) return false; const obj = args as Record<string, unknown>; if (!Array.isArray(obj.keywords) || obj.keywords.length === 0) return false; if (obj.with_urn !== undefined && typeof obj.with_urn !== "boolean") return false; if ( obj.count_per_keyword !== undefined && (typeof obj.count_per_keyword !== "number" || obj.count_per_keyword < 1 || obj.count_per_keyword > 10) ) { return false; } if (obj.timeout !== undefined && typeof obj.timeout !== "number") return false; return true; }