Skip to main content
Glama

search_linkedin_posts

Find LinkedIn posts using keywords, content types, authors, industries, and date filters to gather relevant professional content and insights.

Instructions

Search for LinkedIn posts with various filters like keywords, content type, authors, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
author_industriesNoIndustry URN, can be obtained in /linkedin/search/industries. Or industry name.
author_titleNoAuthor job title.
authorsNoAuthors URN of posts
content_typeNoDesired content type
countYesMax result count
date_postedNoDate postedpast-month
keywordsNoAny keyword for searching in the post. For exact search put desired keywords into brackets
mentionedNoMentioned users URN in posts
sortNoSort typerelevance
timeoutNoMax scrapping execution timeout (in seconds)

Implementation Reference

  • The core handler function that prepares the request payload, makes an API call to the AnySite LinkedIn search posts endpoint, processes the response, logs activity, and handles errors appropriately.
    async ({ keywords, count, timeout, sort, date_posted }) => { const requestData: any = { timeout, keywords, count }; if (sort) requestData.sort = sort; if (date_posted) requestData.date_posted = date_posted; log("Starting LinkedIn posts search with:", JSON.stringify(requestData)); try { const response = await makeRequest(API_CONFIG.ENDPOINTS.LINKEDIN_SEARCH_POSTS, requestData); log(`Search complete, found ${response.length} results`); return { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] }; } catch (error) { log("LinkedIn search posts error:", error); return { content: [{ type: "text", text: `LinkedIn search posts API error: ${formatError(error)}` }], isError: true }; } }
  • Zod schema defining the input parameters for the search_linkedin_posts tool, including descriptions and defaults.
    { keywords: z.string().describe("Search keywords"), count: z.number().default(10).describe("Max results"), timeout: z.number().default(300).describe("Timeout in seconds"), sort: z.string().optional().describe("Sort order"), date_posted: z.string().optional().describe("Date filter")
  • src/index.ts:468-496 (registration)
    Complete MCP server.tool registration for 'search_linkedin_posts', including name, description, input schema, and handler implementation.
    "search_linkedin_posts", "Search LinkedIn posts with keywords and filters", { keywords: z.string().describe("Search keywords"), count: z.number().default(10).describe("Max results"), timeout: z.number().default(300).describe("Timeout in seconds"), sort: z.string().optional().describe("Sort order"), date_posted: z.string().optional().describe("Date filter") }, async ({ keywords, count, timeout, sort, date_posted }) => { const requestData: any = { timeout, keywords, count }; if (sort) requestData.sort = sort; if (date_posted) requestData.date_posted = date_posted; log("Starting LinkedIn posts search with:", JSON.stringify(requestData)); try { const response = await makeRequest(API_CONFIG.ENDPOINTS.LINKEDIN_SEARCH_POSTS, requestData); log(`Search complete, found ${response.length} results`); return { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] }; } catch (error) { log("LinkedIn search posts error:", error); return { content: [{ type: "text", text: `LinkedIn search posts API error: ${formatError(error)}` }], isError: true }; } } );
  • API endpoint constant used by the tool handler for LinkedIn posts search.
    LINKEDIN_SEARCH_POSTS: "/api/linkedin/search/posts",
  • TypeScript interface defining the expected arguments for LinkedIn search posts, providing type safety and documentation.
    export interface LinkedinSearchPostsArgs { timeout?: number; keywords?: string; sort?: "relevance"; date_posted?: "past-month" | "past-week" | "past-24h"; content_type?: "videos" | "photos" | "jobs" | "live_videos" | "documents" | null; mentioned?: string[] | null; authors?: string[] | null; author_industries?: string[] | string | null; author_title?: string | null; count: number; }

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/anysiteio/hdw-mcp-server'

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