Skip to main content
Glama
Selenium39

Weibo MCP Server

get_hot_search

Retrieve trending topics from Weibo's hot search list to monitor current discussions and viral content on the platform.

Instructions

获取当前微博热搜榜的热门话题列表

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitYes返回的最大热搜条目数量

Implementation Reference

  • src/server.ts:68-79 (registration)
    Registration of the MCP tool 'get_hot_search' including input schema (limit: number) and thin handler that calls WeiboCrawler.getHotSearchList
    server.tool("get_hot_search",
      "获取当前微博热搜榜的热门话题列表",
      { 
        limit: z.number().describe("返回的最大热搜条目数量")
      },
      async ({ limit }) => {
        const hotSearchList = await crawler.getHotSearchList(limit);
        return {
          content: [{ type: "text", text: JSON.stringify(hotSearchList) }]
        };
      }
    );
  • Core handler function getHotSearchList that fetches and parses Weibo hot search list from API into HotSearchItem array
    async getHotSearchList(limit: number): Promise<HotSearchItem[]> {
      try {
        const response = await axios.get(HOT_SEARCH_URL, {
          headers: DEFAULT_HEADERS
        });
        
        const data = response.data;
        const cards = data?.data?.cards || [];
        
        if (cards.length === 0) {
          return [];
        }
        
        // 查找包含热搜数据的card
        let hotSearchCard = null;
        for (const card of cards) {
          if (card.card_group && Array.isArray(card.card_group)) {
            hotSearchCard = card;
            break;
          }
        }
        
        if (!hotSearchCard || !hotSearchCard.card_group) {
          return [];
        }
        
        // 转换热搜数据为HotSearchItem格式
        const hotSearchItems: HotSearchItem[] = [];
        let rank = 1;
        
        for (const item of hotSearchCard.card_group) {
          if (item.desc && rank <= limit) {
            const hotSearchItem: HotSearchItem = {
              keyword: item.desc,
              rank: rank,
              hotValue: parseInt(item.desc_extr || '0', 10),
              tag: item.icon ? item.icon.slice(item.icon.lastIndexOf('/') + 1).replace('.png', '') : undefined,
              url: item.scheme
            };
            
            hotSearchItems.push(hotSearchItem);
            rank++;
          }
        }
        
        return hotSearchItems;
      } catch (error) {
        console.error('无法获取微博热搜榜', error);
        return [];
      }
    }
  • TypeScript interface HotSearchItem defining the output structure for hot search items returned by the tool.
    export interface HotSearchItem {
      /**
       * 热搜关键词
       */
      keyword: string;
      
      /**
       * 热搜排名
       */
      rank: number;
      
      /**
       * 热搜热度
       */
      hotValue: number;
      
      /**
       * 标签类型(如新、热、爆等)
       */
      tag?: string;
      
      /**
       * 搜索链接
       */
      url?: string;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. While it indicates this is a read operation ('获取' - get), it doesn't describe important behavioral traits such as rate limits, authentication requirements, data freshness (how current is '当前' - current), pagination, or error conditions. The description is minimal and lacks operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized for a simple tool with one parameter, though it could be slightly more informative without losing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what the return value looks like (e.g., list structure, fields like topic names and metrics), nor does it cover behavioral aspects like rate limits or authentication. For a tool that likely interacts with an external API (Weibo), more context is needed for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with the single parameter 'limit' fully documented in the schema ('返回的最大热搜条目数量' - maximum number of hot search entries to return). The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: '获取当前微博热搜榜的热门话题列表' (Get the current list of hot topics from Weibo's hot search ranking). It specifies the verb ('获取' - get) and resource ('微博热搜榜的热门话题列表' - Weibo hot search ranking topic list). However, it doesn't differentiate from sibling tools like 'search_content' or 'search_users' which might also retrieve content from Weibo.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when this tool is appropriate (e.g., for trending topics vs. general content search) or when to use sibling tools like 'search_content' instead. There's no context about exclusions or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/Selenium39/mcp-server-weibo'

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