Skip to main content
Glama
malaksedarous

Context Optimizer MCP Server

deepResearch

Conduct exhaustive research on complex topics using Exa.ai analysis for critical decision-making and architectural planning.

Instructions

Conduct comprehensive, in-depth research using Exa.ai's exhaustive analysis capabilities for critical decision-making and complex architectural planning.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topicYesThe research topic or problem you want to investigate comprehensively. Be as detailed as possible about what you want to learn, including technical requirements, architectural considerations, performance needs, security concerns, or strategic implications you want analyzed in depth.

Implementation Reference

  • Main handler (execute method) for the deepResearch tool. Validates input (topic), checks Exa API key config, calls conductDeepResearch(), and returns the result.
    async execute(args: any): Promise<MCPToolResponse> {
      try {
        // Validate input
        const validationError = this.validateRequiredFields(args, ['topic']);
        if (validationError) {
          return this.createErrorResponse(validationError);
        }
    
        const input = args as DeepResearchInput;
        
        // Validate topic is not empty
        if (!input.topic.trim()) {
          return this.createErrorResponse('Topic cannot be empty');
        }
    
        // Get configuration
        const config = ConfigurationManager.getConfig();
        if (!config.research.exaKey) {
          return this.createErrorResponse(
            'Exa.ai API key is not configured. Please set the exaKey in your configuration or EXA_KEY environment variable.'
          );
        }
    
        this.logOperation(`Starting deep research for topic: ${input.topic}`);
    
        // Conduct research
        const result = await this.conductDeepResearch(input.topic, config.research.exaKey);
        
        this.logOperation('Deep research completed successfully');
    
        return this.createSuccessResponse(result.result);
    
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        this.logOperation(`Deep research failed: ${errorMessage}`);
        return this.createErrorResponse(`Research failed: ${errorMessage}`);
      }
    }
  • Private method that creates an Exa deep research task using 'exa-research-pro' model, then polls for completion using pollTaskWithFallback (from base class).
    private async conductDeepResearch(topic: string, exaKey: string): Promise<ExaResponse> {
      const client = new Exa(exaKey);
    
      try {
        const schema = {
          type: 'object' as const,
          properties: {
            result: { type: 'string' as const }
          },
          required: ['result'],
          description: 'Schema with just the result in markdown.'
        };
    
        if (!client?.research || typeof (client as any).research.create !== 'function') {
          throw new Error('Exa.js research client missing create() method');
        }
        const research: any = (client as any).research;
    
        this.logOperation('Creating Exa deep research task');
    const task = await research.create({
          instructions: topic,
          model: RESEARCH_CONFIG.DEEP_RESEARCH.MODEL,
          output: { schema },
        });
    
        this.logOperation(`Task created with ID: ${task.id}. Polling for results...`);
        const result = await this.pollTaskWithFallback(
          client, 
          task.id, 
          RESEARCH_CONFIG.DEEP_RESEARCH.MAX_ATTEMPTS,
          RESEARCH_CONFIG.DEEP_RESEARCH.POLL_INTERVAL_MS,
          RESEARCH_CONFIG.DEEP_RESEARCH.TIMEOUT_MS
        );
        
        return this.formatResponse(result);
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : 'Failed to conduct deep research with Exa.ai.';
        throw new Error(`Exa.ai deep research failed: ${errorMessage}`);
      }
    }
  • Input type definition for deepResearch tool - accepts a single 'topic' string.
    interface DeepResearchInput {
      topic: string;
    }
  • JSON Schema input validation for the deepResearch tool. Requires a single 'topic' string property.
    readonly inputSchema = {
      type: 'object' as const,
      properties: {
        topic: {
          type: 'string' as const,
          description: 'The research topic or problem you want to investigate comprehensively. Be as detailed as possible about what you want to learn, including technical requirements, architectural considerations, performance needs, security concerns, or strategic implications you want analyzed in depth.'
        }
      },
      required: ['topic']
    };
  • src/server.ts:61-67 (registration)
    Registration of DeepResearchTool in the MCP server's setupTools method. The tool is instantiated and added to the tools map, making it available via ListToolsRequestSchema and CallToolRequestSchema handlers.
    const toolInstances = [
      new AskAboutFileTool(),
      new RunAndExtractTool(),
      new AskFollowUpTool(),
      new ResearchTopicTool(),
      new DeepResearchTool()
    ];
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 does not mention any behavioral traits such as rate limits, costs, internal processes, or side effects. For a research tool, the description lacks important context about what happens during the research or how results are returned.

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 a single sentence that efficiently conveys the tool's purpose and target scenarios. No unnecessary words or repetition, earning high marks for conciseness.

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?

For a tool with one required parameter and no output schema or annotations, the description provides adequate context about purpose but lacks behavioral details. It is sufficiently complete for a simple tool, but could be improved with transparency about the research process or limitations.

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 input schema's parameter 'topic' has a detailed description that already covers semantic guidance, including recommendations for technical requirements, architectural considerations, etc. The tool description does not add further information about parameters beyond what the schema provides, so the baseline score of 3 is appropriate given 100% 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 that the tool conducts comprehensive, in-depth research using Exa.ai for critical decision-making and complex architectural planning. It specifies the verb 'research' and the resource 'Exa.ai's exhaustive analysis capabilities,' but does not explicitly differentiate it from the sibling tool 'researchTopic', which likely has a similar purpose.

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

Usage Guidelines3/5

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

The description implies usage for high-stakes situations like critical decision-making and architectural planning, but it does not provide explicit when-to-use or when-not-to-use guidance, nor does it mention alternatives among sibling tools.

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/malaksedarous/context-optimizer-mcp-server'

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