Skip to main content
Glama

get-toutiao-trending

Fetch trending topics from Toutiao across politics, society, technology, and entertainment using this tool. Stay updated on popular Chinese news and events with Trends Hub.

Instructions

获取今日头条热榜,包含时政要闻、社会事件、国际新闻、科技发展及娱乐八卦等多领域的热门中文资讯

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that fetches trending topics from Toutiao's hot board API using HTTP GET request, processes the response data by mapping it to a standardized format with title, cover image, popularity score, and clean link, and throws an error if data is invalid.
    func: async () => { const resp = await http.get<{ data: any[]; }>('https://www.toutiao.com/hot-event/hot-board/', { params: { origin: 'toutiao_pc', }, }); if (!Array.isArray(resp.data.data)) { throw new Error('获取今日头条热榜失败'); } return resp.data.data.map((item) => { const link = new URL(item.Url); link.search = ''; return { title: item.Title, cover: item.Image.url, popularity: item.HotValue, link: link.toString(), }; });
  • The tool registration using defineToolConfig, specifying the name 'get-toutiao-trending', description in Chinese, and the handler function.
    export default defineToolConfig({ name: 'get-toutiao-trending', description: '获取今日头条热榜,包含时政要闻、社会事件、国际新闻、科技发展及娱乐八卦等多领域的热门中文资讯', func: async () => { const resp = await http.get<{ data: any[]; }>('https://www.toutiao.com/hot-event/hot-board/', { params: { origin: 'toutiao_pc', }, }); if (!Array.isArray(resp.data.data)) { throw new Error('获取今日头条热榜失败'); } return resp.data.data.map((item) => { const link = new URL(item.Url); link.search = ''; return { title: item.Title, cover: item.Image.url, popularity: item.HotValue, link: link.toString(), }; }); }, });

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/baranwang/mcp-trends-hub'

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