get_topic_tree
Analyze conversation topic structures from social media searches to visualize how topics and subtopics distribute across platforms like Twitter, Bluesky, and YouTube.
Instructions
Get the conversation topic tree for a keyword search. Shows how topics and subtopics are distributed across the search results.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| search_id | Yes | Keyword search ID | |
| platform | No | Filter by platform |
Implementation Reference
- src/tools/topic-tree.ts:16-24 (handler)The handler function for get_topic_tree tool.
async (params) => { try { const query = params.platform ? `?platform=${params.platform}` : ""; const data = await apiGet(`/iq/keyword_search/${params.search_id}/topic_tree${query}`); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } catch (e) { return { content: [{ type: "text", text: String(e) }], isError: true }; } } - src/tools/topic-tree.ts:6-25 (registration)Registration of the get_topic_tree tool.
server.tool( "get_topic_tree", "Get the conversation topic tree for a keyword search. Shows how topics and subtopics are distributed across the search results.", { search_id: z.number().int().positive().describe("Keyword search ID"), platform: z .enum(["twitter", "bluesky", "youtube"]) .optional() .describe("Filter by platform"), }, async (params) => { try { const query = params.platform ? `?platform=${params.platform}` : ""; const data = await apiGet(`/iq/keyword_search/${params.search_id}/topic_tree${query}`); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } catch (e) { return { content: [{ type: "text", text: String(e) }], isError: true }; } } );