Skip to main content
Glama

deep-research

Conducts multi-round deep web research using keywords and topics to gather comprehensive information for answering complex questions.

Instructions

Deep web information search tool that can conduct multi-round in-depth research based on keywords and topics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
questionYesUser question
referenceNoReference materials
keywordsNoSearch keywords, please provide 1~5 keywords. Each keyword must: include complete subject and predicate, avoid pronouns and references, have independent search value, avoid logical overlap between keywords, and be directly relevant to the question
topicNoSearch topicgeneral
roundsNoCurrent search round, defaults to 1

Implementation Reference

  • The core handler function that implements the 'deep-research' tool logic. Parses input schema, checks API key, performs parallel Tavily searches if keywords provided, accumulates results, and returns a generated prompt.
    async function deepResearch(args: unknown): Promise<ServerResult> {
      if (!CONFIG.TAVILY_API_KEY) {
        return {
          isError: true,
          content: [
            {
              type: 'text',
              text: 'Please configure the `TAVILY_API_KEY` environment variable, get it from https://tavily.com/',
            },
          ],
        };
      }
    
      const { question, reference = '', keywords = [], topic, rounds } = DeepResearchToolSchema.parse(args);
    
      let searchResults = reference;
      if (keywords.length) {
        const results = await Promise.allSettled(keywords.map((keyword) => searchTavily(keyword, { topic })));
    
        searchResults += results
          .filter((result): result is PromiseFulfilledResult<string> => result.status === 'fulfilled')
          .map((result) => result.value)
          .join('\n');
      }
    
      return {
        content: [
          {
            type: 'text',
            text: generatePrompt(question, searchResults, rounds),
          },
        ],
      };
    }
  • Zod schema for input validation of the 'deep-research' tool, defining parameters like question, keywords, topic, etc.
    const DeepResearchToolSchema = z.object({
      question: z.string().describe('User question'),
      reference: z.string().optional().describe('Reference materials'),
      keywords: z
        .array(z.string())
        .min(0)
        .max(CONFIG.MAX_SEARCH_KEYWORDS)
        .optional()
        .describe(
          `Search keywords, please provide 1~${CONFIG.MAX_SEARCH_KEYWORDS} keywords. Each keyword must: include complete subject and predicate, avoid pronouns and references, have independent search value, avoid logical overlap between keywords, and be directly relevant to the question`,
        ),
      topic: z.enum(['general', 'news', 'finance']).default('general').describe('Search topic'),
      rounds: z.number().default(1).describe('Current search round, defaults to 1'),
    });
  • src/index.ts:162-171 (registration)
    Registration of the 'deep-research' tool metadata (name, description, schema) for the ListToolsRequestSchema.
    mcpServer.server.setRequestHandler(ListToolsRequestSchema, () => ({
      tools: [
        {
          name: 'deep-research',
          description:
            'Deep web information search tool that can conduct multi-round in-depth research based on keywords and topics',
          inputSchema: zodToJsonSchema(DeepResearchToolSchema),
        },
      ],
    }));
  • src/index.ts:173-174 (registration)
    Registration of the deepResearch handler for the CallToolRequestSchema.
    mcpServer.server.setRequestHandler(CallToolRequestSchema, (request) => deepResearch(request.params.arguments));
  • Helper function to perform a single Tavily search and format the results as markdown.
    async function searchTavily(keyword: string, options: TavilySearchOptions): Promise<string> {
      const tvly = tavily({ apiKey: CONFIG.TAVILY_API_KEY });
      const response = await tvly.search(keyword, options);
      let result = `## Search Results for \`${response.query}\`\n`;
      response.results.forEach((searchResult, index) => {
        result += `### Reference ${index + 1}:\n`;
        result += `Title: ${searchResult.title}\n`;
        result += `Content: ${searchResult.content}\n`;
      });
      return result;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'deep web' and 'multi-round' aspects, but fails to disclose critical behavioral traits like authentication requirements, rate limits, privacy implications of deep web access, or what constitutes a 'round' in practical terms.

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 appropriately concise with a single sentence that front-loads the core functionality. While efficient, it could be slightly more structured by separating the tool's purpose from its operational characteristics.

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?

For a complex research tool with 5 parameters and no output schema, the description is insufficient. It doesn't explain what 'deep web' means in this context, what format results return, how multi-round research differs from single-round, or what happens when reference materials are provided.

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%, providing solid baseline documentation for all 5 parameters. The description adds minimal value beyond the schema, mentioning 'keywords and topics' which are already well-documented in the input schema with detailed constraints for keywords.

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 'deep web information search' and 'multi-round in-depth research' based on keywords and topics, which is a specific verb+resource combination. However, with no sibling tools mentioned, there's no opportunity to distinguish from alternatives, preventing a perfect score.

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 other search methods or alternatives. It mentions 'multi-round in-depth research' but doesn't specify what qualifies as needing such depth or when simpler search tools might suffice.

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/baranwang/mcp-deep-research'

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