Skip to main content
Glama

实时数据/腾讯新闻热榜

Access real-time trending news from Tencent News to stay informed about current events and popular topics.

Instructions

实时数据/腾讯新闻热榜

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function executed for the tool '实时数据/腾讯新闻热榜'. It makes a POST request to https://xiaobenyang.com/api with the tool's aid (apiId) and user-provided arguments, using API_KEY from env.
    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();
    }
  • Dynamically registers the tool '实时数据/腾讯新闻热榜' (and others) by calling addToolXiaoBenYangApi with apiDesc.title as name, where apiDesc comes from fetched https://xiaobenyang.com/api/{MCP_ID}.
    for (const apiDesc of apiDescList) {
        addToolXiaoBenYangApi(apiDesc.apiId.toString(),
            apiDesc.title,
            apiDesc.description ? apiDesc.description : apiDesc.title,
            convertParamsToZ(apiDesc.params));
    }
  • Converts Java-style parameter descriptions from the API response into Zod schema for input validation of tools like '实时数据/腾讯新闻热榜'.
    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);
    }
  • Helper function that maps Java types (with generics) from API descriptions to Zod types, used in schema generation for the tool.
    function convertJavaTypeToZod(javaType) {
        // 解析泛型(如处理 "List<Integer>" 这种格式)
        const {base: baseType, generics} = parseGenericType(javaType);
    
        // 优先匹配全类名(如 "java.lang.String")
        if (JAVA_TO_ZOD_MAP[baseType]) {
            return JAVA_TO_ZOD_MAP[baseType](...generics);
        }
    
        // 若全类名未匹配,提取简单类名再匹配(如 "String" 从 "java.lang.String" 提取)
        const simpleTypeName = baseType.split('.').pop();
        if (JAVA_TO_ZOD_MAP[simpleTypeName]) {
            return JAVA_TO_ZOD_MAP[simpleTypeName](...generics);
        }
    
        // 未匹配的类型默认视为自定义对象(返回 z.object(),需手动补充)
        return z.object({});
    }
  • Registers individual tools on the FastMCP server, setting name to title (e.g., '实时数据/腾讯新闻热榜'), schema to params, and execute to the shared handler with tool-specific aid.
    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);
            }
        });
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.4/5.0
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. It only states the source ('腾讯新闻热榜'), without describing what the tool does (e.g., returns a list, fetches data), any constraints (e.g., rate limits, authentication needs), or output behavior. This is inadequate for a tool with zero annotation coverage, as it leaves critical behavioral traits unspecified.

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

Conciseness3/5

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

The description is extremely concise—just the tool name repeated—which could be seen as efficient but results in under-specification. It's front-loaded with the source, but every sentence (in this case, the single phrase) doesn't earn its place by adding value beyond the name. It's brief but lacks substance, making it more sparse than optimally structured.

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 complexity (a data-fetching tool likely returning hot list items), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., list of articles, rankings), any behavioral aspects, or usage context. For a tool with siblings and potential data-rich output, this minimal description fails to provide enough information for effective agent use.

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

Parameters4/5

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

The tool has 0 parameters, and schema description coverage is 100%, so there's no need for parameter information in the description. The description doesn't add meaning beyond the schema, but with no parameters, the baseline is 4. It appropriately avoids unnecessary parameter details, though it could hint at implicit context if relevant.

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

Purpose2/5

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

Tautological: description restates name/title.

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. Given the sibling tools include other hot lists (e.g., '实时数据/微博热搜' for Weibo, '实时数据/知乎热榜' for Zhihu), there's an implied context of fetching hot lists from different platforms, but no explicit when/when-not instructions or named alternatives are mentioned. This leaves usage unclear beyond the source name.

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