Skip to main content
Glama
OEvortex

DuckDuckGo Search MCP

by OEvortex

Monica AI Search

monica-search
Read-only

Get AI-generated answers to search queries by analyzing web content through DuckDuckGo Search MCP, providing privacy-friendly access to real-time information.

Instructions

AI-powered search using Monica AI. Returns AI-generated responses based on web content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe search query or question.

Implementation Reference

  • The main execution handler for the 'monica-search' MCP tool. Extracts query from params, calls the searchMonica helper, and returns formatted text content or error response.
    /**
     * Monica AI search tool handler
     * @param {Object} params - The tool parameters
     * @returns {Promise<Object>} - The tool result
     */
    export async function monicaToolHandler(params) {
      const { query } = params;
      
      console.log(`Searching Monica AI for: "${query}"`);
      
      try {
        const result = await searchMonica(query);
        return {
          content: [
            {
              type: 'text',
              text: result || 'No results found.'
            }
          ]
        };
      } catch (error) {
        console.error(`Error in Monica search: ${error.message}`);
        return {
          isError: true,
          content: [
            {
              type: 'text',
              text: `Error searching Monica: ${error.message}`
            }
          ]
        };
      }
    }
  • The tool definition object including name, title, description, inputSchema for parameter validation, and annotations.
    /**
     * Monica AI search tool definition
     */
    export const monicaToolDefinition = {
      name: 'monica-search',
      title: 'Monica AI Search',
      description: 'AI-powered search using Monica AI. Returns AI-generated responses based on web content.',
      inputSchema: {
        type: 'object',
        properties: {
          query: {
            type: 'string',
            description: 'The search query or question.'
          }
        },
        required: ['query']
      },
      annotations: {
        readOnlyHint: true,
        openWorldHint: false
      }
    };
  • src/index.js:49-61 (registration)
    In the MCP CallToolRequest handler, routes calls to 'monica-search' to the monicaToolHandler function.
    switch (name) {
      case 'web-search':
        return await searchToolHandler(args);
    
      case 'iask-search':
        return await iaskToolHandler(args);
    
      case 'monica-search':
        return await monicaToolHandler(args);
    
      default:
        throw new Error(`Tool not found: ${name}`);
    }
  • src/index.js:14-18 (registration)
    Includes monicaToolDefinition in the list of tools returned by ListToolsRequestSchema handler.
    const availableTools = [
      searchToolDefinition,
      iaskToolDefinition,
      monicaToolDefinition
    ];
  • The core helper function implementing the API interaction with Monica AI, including client instantiation, streaming request handling, response formatting, and comprehensive error management.
    /**
     * Search using Monica AI
     * @param {string} query - The search query
     * @returns {Promise<string>} The search results
     */
    export async function searchMonica(query) {
      // Input validation
      if (!query || typeof query !== 'string') {
        throw new Error('Invalid query: query must be a non-empty string');
      }
    
      console.log(`Monica AI search starting: "${query}"`);
    
      try {
        const client = new MonicaClient();
        const result = await client.search(query);
        
        if (result && result.trim()) {
          console.log(`Monica AI search completed: ${result.length} characters received`);
        } else {
          console.log('Monica AI search completed but returned empty result');
        }
        
        return result;
      } catch (error) {
        console.error('Error in Monica AI search:', error.message);
        
        // Enhanced error handling
        if (error.code === 'ENOTFOUND') {
          throw new Error('Monica network error: unable to resolve host');
        }
        
        if (error.code === 'ECONNREFUSED') {
          throw new Error('Monica network error: connection refused');
        }
        
        if (error.message.includes('timeout')) {
          throw new Error('Monica timeout: request took too long');
        }
        
        if (error.message.includes('network')) {
          throw new Error('Monica network error: service may be unavailable');
        }
        
        throw new Error(`Monica search failed for "${query}": ${error.message}`);
      }
    }
Behavior3/5

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

Annotations indicate readOnlyHint=true and openWorldHint=false, which the description doesn't contradict. The description adds value by specifying that responses are 'AI-generated' and based on 'web content,' providing context beyond annotations. However, it doesn't detail behavioral traits like rate limits, response format, or potential limitations, so it's adequate but not comprehensive.

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, efficient sentence that front-loads key information ('AI-powered search using Monica AI') and avoids unnecessary details. Every word contributes to understanding the tool's purpose, making it appropriately sized with zero waste.

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 simple search tool with one parameter, 100% schema coverage, and annotations covering safety (readOnlyHint) and scope (openWorldHint), the description is minimally complete. However, without an output schema, it doesn't explain return values or potential errors, and it lacks sibling differentiation, leaving some contextual gaps.

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 single parameter 'query' fully documented in the schema. The description doesn't add any parameter-specific semantics beyond what the schema provides, such as query formatting or examples. Given the high schema coverage, the baseline score of 3 is appropriate.

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 'AI-powered search' and 'returns AI-generated responses based on web content,' which specifies both the verb (search) and resource (web content). However, it doesn't explicitly differentiate from sibling tools like 'iask-search' and 'web-search,' which likely offer similar search functionality, so it doesn't reach the highest 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 the sibling tools 'iask-search' and 'web-search.' It lacks explicit when/when-not instructions or alternatives, leaving the agent to infer usage based on the tool name and description alone.

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/OEvortex/ddg_search'

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