get_keyword_search_posts
Retrieve social media posts matching specific keywords across platforms like Twitter, Reddit, and YouTube for search and analysis purposes.
Instructions
Get raw posts from a keyword search. Returns the actual social media posts matching the search query.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| search_id | Yes | Keyword search ID | |
| platform | No | Filter by platform (default: all) |
Implementation Reference
- src/tools/posts.ts:8-27 (registration)The "get_keyword_search_posts" tool is defined and implemented directly within the registration block in src/tools/posts.ts. The handler is the inline async function passed as the fourth argument.
server.tool( "get_keyword_search_posts", "Get raw posts from a keyword search. Returns the actual social media posts matching the search query.", { search_id: z.number().int().positive().describe("Keyword search ID"), platform: z .enum(["all", "twitter", "reddit", "bluesky", "youtube", "instagram", "facebook", "weibo", "linkedin"]) .optional() .describe("Filter by platform (default: all)"), }, async (params) => { try { const query = params.platform ? `?platform=${params.platform}` : ""; const data = await apiGet(`/iq/keyword_search/${params.search_id}/posts_data${query}`); return { content: [{ type: "text", text: `${UNTRUSTED_CONTENT_NOTICE}\n\n${JSON.stringify(data, null, 2)}` }] }; } catch (e) { return { content: [{ type: "text", text: String(e) }], isError: true }; } } );