Skip to main content
Glama
aliyun

TongXiao Common Search MCP Server

by aliyun

common_search

Search the web for clean, accurate information using enhanced real-time capabilities that integrate multiple data sources to deliver high-quality results.

Instructions

标准搜索接口提供增强的网络开放域的实时搜索能力,通过大模型优化与多数据源融合的技术,查询干净、准确、多样、高质量的结果。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes搜索问题(长度:>=2 and <=100)

Implementation Reference

  • The handler function that executes the 'common_search' tool. It sends a POST request to the TongXiao API with the query, processes the search results into a formatted Markdown string with title, URL, site, date, and summary for each result, and returns it as text content.
    export async function handleCommonSearch(TONGXIAO_API_KEY: string, params: any) {
        const { query } = params
        const url = new URL("https://cloud-iqs.aliyuncs.com/search/llm");
    
        const response = await fetch(url.toString(), {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
                "X-API-Key": TONGXIAO_API_KEY
            },
            body: JSON.stringify({
                "query": query,
                "numResults": 5
            })
        });
    
        if (response.status != 200) {
            const errorData = await response.text();
            handleSearchError('common_search', response.status, errorData);
        }
    
        const data = await response.json();
        const pageItems = data.pageItems
        const pageResults: string[] = []
        for (let pageItem of pageItems) {
            let publishDate;
            if (pageItem.publishTime) {
                let date = new Date(pageItem.publishTime);
                publishDate = date.toISOString().split('T')[0];
            } else {
                publishDate = '';
            }
    
            const pageResult = `
    标题:${pageItem.title || ''}
    URL:${pageItem.link || ''}
    站点名称:${pageItem.hostname || ''}
    发布时间:${publishDate}
    摘要:
    ${pageItem.summary || pageItem.snippet || ''}
            `.trim();
            pageResults.push(pageResult);
        }
        
    
        let markdown = `# 搜索结果\n`
        markdown += pageResults.join("\n\n---\n\n");
    
        return {
            content: [{
                type: "text",
                text: markdown
            }],
            isError: false
        };
    }
  • The tool definition object including name, description, and inputSchema for the 'common_search' tool.
    export const COMMON_SEARCH_TOOL = {
        name: "common_search",
        description: "标准搜索接口提供增强的网络开放域的实时搜索能力,通过大模型优化与多数据源融合的技术,查询干净、准确、多样、高质量的结果。",
        inputSchema: {
            type: "object",
            properties: {
                query: {
                    type: "string",
                    description: "搜索问题(长度:>=2 and <=100)"
                }
            },
            required: ["query"]
        }
    };
  • src/index.ts:25-30 (registration)
    Registers the 'common_search' tool in the TOOLS list (used for listTools) and maps its name to the handler function in TOOL_FUNCTIONS (used for callTool).
    const TOOLS = [
        COMMON_SEARCH_TOOL,
    ];
    const TOOL_FUNCTIONS = {
        [COMMON_SEARCH_TOOL.name]: handleCommonSearch
    }
  • src/index.ts:33-35 (registration)
    MCP server request handler for listing tools, which returns the registered TOOLS including 'common_search'.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
        tools: TOOLS,
    }));
  • Helper function to handle and throw MCP errors for common search API failures based on HTTP status codes.
    function handleSearchError(api: string, status: number, errorData: any): never {
        let code: number;
        let message: string;
        
        switch (status) {
            case 404:
                message = "Specified access key is not found.";
                break;
            case 403:
                message = "Please activate AI search service";
                break;
            case 429:
                message = "Request was denied due to user flow control.";
                break;
            default:
                message = errorData || "Unknown Error";
        }
    
        throw new McpError(status, `${api} 搜索失败: ${message}`);
    }
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. It mentions 'enhanced capabilities' and 'optimized by large models,' but fails to disclose critical behavioral traits such as rate limits, authentication needs, response format, or error handling. This leaves significant gaps for an agent.

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 front-loads the core functionality ('standard search interface provides enhanced real-time search capabilities'). It avoids redundancy but could be slightly more structured for clarity.

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 omits details on return values, error cases, and operational constraints like rate limits or data sources, which are essential for a search tool with real-time claims.

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?

Schema description coverage is 100%, with the parameter 'query' documented as a search question with length constraints. The description adds no additional parameter semantics beyond what the schema provides, such as query formatting examples or supported languages, meeting 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 as providing 'enhanced real-time search capabilities for the open web domain' with 'clean, accurate, diverse, high-quality results.' It specifies the verb (search) and resource (open web), but since there are no sibling tools, it cannot demonstrate differentiation from alternatives.

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 mentions general capabilities like 'real-time search' and 'multi-source fusion,' but provides no explicit guidance on when to use this tool versus alternatives, prerequisites, or exclusions. Without sibling tools, it lacks comparative context.

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/aliyun/alibabacloud-iqs-tongxiao-mcp-server'

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