Skip to main content
Glama
mingdedi

Internetsearch-mcp-server

InternetSearch

Search the internet for answers to questions using a search API. Provide a query to find relevant information online.

Instructions

联网搜索对应问题的答案

Args: query: 需要联网搜索的问题

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
txt_countNo

Implementation Reference

  • The main handler function for the InternetSearch tool. It is decorated with @mcp.tool() to register it with the FastMCP server. The function performs an internet search using the BochaAI API, extracts summaries from search results, and returns them concatenated with IDs.
    @mcp.tool()
    def InternetSearch(query,txt_count=5):
        """联网搜索对应问题的答案
    
        Args:
            query: 需要联网搜索的问题
        """
        headers = {
            "Authorization": f"Bearer {SEARCH_API_KEY}",  # 替换为你的实际 API Key
            "Content-Type": "application/json"
        }
    
        payload = {
            "query": f"{query}",
            "freshness": "noLimit",
            "count": txt_count,
            "answer": False,
            "stream": False
        }
    
        Webtxt=""
    
        try:
            print("开始联网搜索")
            response = requests.post(
                "https://api.bochaai.com/v1/ai-search",
                headers=headers,
                json=payload
            )
            response.raise_for_status()  # 检查 HTTP 错误 
            i=0
            for value in json.loads((response.json()["messages"][0]["content"]))["value"]:
                Webtxt=Webtxt+f"参考资料id:{i}\n"+value["summary"]+"\n"
                i+=1
            #为了兼容web-search添加的代码
            # for value in response.json()["data"]["webPages"]["value"]:
            #     Webtxt=Webtxt+f"参考资料id:{i}\n"+value["snippet"]+"\n"
            #     i+=1
             # 解析并叠加响应
        except requests.exceptions.RequestException as e:
            print(f"Request failed: {e}")
        except ValueError as e:
            print(f"Failed to parse JSON response: {e}")
        return Webtxt
  • Initialization of the FastMCP server instance named 'Internet-search', to which the tool is registered via decorator.
    mcp = FastMCP("Internet-search")
  • Docstring defining the tool's description and input parameters (query). Note: txt_count parameter is defined in function signature but not documented here.
    """联网搜索对应问题的答案
    
    Args:
        query: 需要联网搜索的问题
    """
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 mentions the tool performs internet searches but doesn't describe how it works (e.g., search engine used, rate limits, authentication needs, privacy implications, or what happens on failure). For a tool that interacts with external resources, this lack of transparency is a significant gap.

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 concise and front-loaded with the main purpose in the first sentence. The Args section is structured but could be more integrated. There's no wasted text, though it could benefit from slightly more detail without losing efficiency.

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 tool's complexity (internet search with external interactions), lack of annotations, no output schema, and low parameter coverage, the description is incomplete. It doesn't address behavioral aspects like error handling, result format, or limitations, which are crucial for an AI agent to use it effectively.

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 description adds minimal parameter semantics: it explains that 'query' is '需要联网搜索的问题' (the question that needs internet search). With schema description coverage at 0% and 2 parameters (query and txt_count), the description only covers one parameter partially. It doesn't explain txt_count at all, leaving it undocumented. Baseline is 3 due to some value added but incomplete 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 '联网搜索对应问题的答案' (search the internet for answers to corresponding questions), which is a specific verb+resource combination. It distinguishes itself as an internet search tool, though with no sibling tools mentioned, differentiation isn't applicable. The purpose is unambiguous but could be more precise about what type of answers it provides.

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, prerequisites, or context for usage. It simply states what the tool does without indicating scenarios where it's appropriate or inappropriate. With no sibling tools, this is less critical, but still a gap in usage 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/mingdedi/InternetSearch-mcp-server'

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