Skip to main content
Glama

DeepSearch 定向检索

deepsearch-web

Perform targeted web searches for specific sites or time periods using the DeepSearch model, delivering more accurate results than standard AI search tools while requiring additional processing time.

Instructions

针对站点或时间范围的 DeepSearch 定向检索,拥有比AI Agent内置搜索更好的搜索效果但更耗时,需要平衡需求

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
top_kNo
localeNo
filtersYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYes
usageYes
metadataYes

Implementation Reference

  • main.ts:102-132 (registration)
    Registers the 'deepsearch-web' MCP tool with title, description, input/output schemas, and an inline handler that delegates to DeepSearchWebAgent.search and formats the result.
    server.registerTool(
      "deepsearch-web",
      {
        title: "DeepSearch 定向检索",
        description: "针对站点或时间范围的 DeepSearch 定向检索,拥有比AI Agent内置搜索更好的搜索效果但更耗时,需要平衡需求",
        inputSchema: deepSearchWebInputShape,
        outputSchema: searchResultShape,
      },
      async (args) => {
        const toolLogger = logger.child({ tool: "deepsearch-web" });
        toolLogger.info("收到工具调用", args);
        const result = await deepsearchWebAgent.search(args.query, {
          top_k: args.top_k,
          locale: args.locale,
          filters: args.filters,
        });
    
        const structured = searchResultSchema.parse(result);
        toolLogger.info("完成工具调用", { itemCount: structured.items.length });
    
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify(structured, null, 2),
            },
          ],
          structuredContent: structured,
        };
      },
    );
  • main.ts:33-40 (schema)
    Defines the input schema for deepsearch-web tool, extending deepSearchInputShape with validation requiring 'site' or 'time_range' in filters.
    const deepSearchWebInputShape = {
      ...deepSearchInputShape,
      filters: z
        .record(z.any())
        .refine((filters) => typeof filters.site === "string" || typeof filters.time_range === "string", {
          message: "filters 需要包含 site 或 time_range 字段",
        }),
    };
  • main.ts:110-131 (handler)
    The inline handler function for the deepsearch-web tool: logs the call, invokes the agent's search method, parses the result, and returns formatted content with structured data.
    async (args) => {
      const toolLogger = logger.child({ tool: "deepsearch-web" });
      toolLogger.info("收到工具调用", args);
      const result = await deepsearchWebAgent.search(args.query, {
        top_k: args.top_k,
        locale: args.locale,
        filters: args.filters,
      });
    
      const structured = searchResultSchema.parse(result);
      toolLogger.info("完成工具调用", { itemCount: structured.items.length });
    
      return {
        content: [
          {
            type: "text" as const,
            text: JSON.stringify(structured, null, 2),
          },
        ],
        structuredContent: structured,
      };
    },
  • DeepSearchWebAgent.search: Enforces required filters (site or time_range), logs, and delegates to the MCP client search.
    async search(query: string, options: SearchOptions = {}): Promise<SearchResult> {
      const filters = options.filters ?? {};
      if (!filters.site && !filters.time_range) {
        this.logger.error("缺少必要过滤条件", { query, options });
        throw new Error("deepsearch-web 需要提供 site 或 time_range 过滤条件");
      }
    
      this.logger.info("执行定向检索", { query, options });
      return this.client.search(query, { ...options, filters });
    }
  • In DeepSearchTransport.buildUserPrompt, adds specific instruction for 'deepsearch-web' toolName to enforce using site/time_range filters in the API prompt.
    toolName === "deepsearch-web"
      ? "必须使用 filters 中的 site/time_range 限制,确保返回结果满足条件。"
      : "可结合 filters 中提供的约束优化检索。";
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It discloses the key behavioral trait of being '更耗时' (more time-consuming), which is valuable. However, it doesn't mention other important behaviors like authentication requirements, rate limits, error conditions, or what '更好的搜索效果' specifically means in terms of result quality or format.

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

Conciseness5/5

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

The description is extremely concise with just one sentence that efficiently communicates purpose, scope, quality/time trade-off, and usage consideration. Every element earns its place with zero wasted words, and the key information is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 4 parameters with 0% schema coverage and no annotations, but does have an output schema, the description is moderately complete. It covers the core purpose and trade-offs but lacks parameter guidance. The output schema existence means return values are documented elsewhere, reducing the burden on the description.

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

Parameters2/5

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

With 0% schema description coverage and 4 parameters (2 required), the description provides no information about any parameters. It mentions '针对站点或时间范围' (for sites or time ranges) which might relate to the 'filters' parameter, but doesn't explain how to use it. The description fails to compensate for the complete lack of schema documentation.

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 performs 'DeepSearch 定向检索' (DeepSearch targeted retrieval) with specific scope ('针对站点或时间范围' - for sites or time ranges). It distinguishes from generic search by mentioning '比AI Agent内置搜索更好的搜索效果' (better search results than AI Agent built-in search). However, it doesn't explicitly name the sibling tool 'deepsearch' for comparison.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear usage context: '需要平衡需求' (need to balance requirements) and mentions the trade-off between '更好的搜索效果' (better search results) and '更耗时' (more time-consuming). It implies this should be used when higher quality results are worth the time cost, though it doesn't explicitly state when NOT to use it or name the sibling 'deepsearch' as an alternative.

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/yuemingruoan/DeepSearch-MCP'

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