Skip to main content
Glama

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
NameRequiredDescriptionDefault
search_idYesKeyword search ID
platformNoFilter by platform

Implementation Reference

  • 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 };
      }
    }
  • 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 };
        }
      }
    );

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/rolliinc/rolli-mcp'

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