实时数据/搜狗热榜
Access real-time trending topics and popular searches from Sogou to monitor current internet discussions and emerging topics.
Instructions
实时数据/搜狗热榜
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/test_stdio_list.js:144-148 (handler)Generic handler executed for the tool '实时数据/搜狗热榜'. It merges user-provided arguments with the tool-specific aid and forwards the request to the xiaobenyang.com API.
execute: async (args) => { // 合并用户输入 args 和工具专属 aid const fullArgs = {...args, aid: aid}; return calcXiaoBenYangApi(fullArgs); } - src/test_stdio_list.js:152-157 (registration)Dynamic registration loop where the tool '实时数据/搜狗热榜' is registered if its title matches apiDesc.title from the external API response.
for (const apiDesc of apiDescList) { addToolXiaoBenYangApi(apiDesc.apiId.toString(), apiDesc.title, apiDesc.description ? apiDesc.description : apiDesc.title, convertParamsToZ(apiDesc.params)); } - src/test_stdio_list.js:109-123 (schema)Function that generates Zod schema for tool input parameters based on Java type descriptions from the external API.
const convertParamsToZ = function (params) { let zParams = {}; for (const param of params) { let zodType = convertJavaTypeToZod(param.type) if (param.description) { zodType = zodType.describe(param.name); } if (param.required) { zodType = zodType.optional(); } zParams[param.name] = zodType; } return z.object(zParams); } - src/test_stdio_list.js:6-17 (helper)Helper function that performs the actual API call to xiaobenyang.com/api using the tool's aid and arguments. This implements the core logic for all tools including '实时数据/搜狗热榜'.
const calcXiaoBenYangApi = async function (fullArgs) { // 发起 GET 请求 let response = await fetch('https://xiaobenyang.com/api', { method: 'POST', headers: { 'APIKEY': process.env.API_KEY, 'aid': fullArgs.aid }, body: new URLSearchParams(fullArgs) }); return await response.text(); } - src/test_stdio_list.js:139-150 (helper)Helper function that registers each individual tool with name, description, parameters, and the shared handler.
const addToolXiaoBenYangApi = function (aid, title, desc, params) { server.addTool({ name: title, description: desc, parameters: params, execute: async (args) => { // 合并用户输入 args 和工具专属 aid const fullArgs = {...args, aid: aid}; return calcXiaoBenYangApi(fullArgs); } }); }