Skip to main content
Glama
yokingma

OneSearch MCP Server

one_search

Search and retrieve web content using multiple search engines. Specify queries, categories, and time ranges to find relevant information from web pages.

Instructions

Search and retrieve content from web pages. Returns SERP results by default (url, title, description).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query string
limitNoMaximum number of results to return (default: 10)
languageNoLanguage code for search results (default: auto)
categoriesNoCategories to search for (default: general)
timeRangeNoTime range for search results (default: all)

Implementation Reference

  • Executes the one_search tool: validates input, invokes processSearch, formats search results into MCP content response.
          case 'one_search': {
            // check args.
            if (!checkSearchArgs(args)) {
              throw new Error(`Invalid arguments for tool: [${name}]`);
            }
            try {
              const { results, success } = await processSearch({
                ...args,
                apiKey: SEARCH_API_KEY ?? '',
                apiUrl: SEARCH_API_URL,
              });
              if (!success) {
                throw new Error('Failed to search');
              }
              const resultsText = results.map((result) => (
                `Title: ${result.title}
    URL: ${result.url}
    Description: ${result.snippet}
    ${result.markdown ? `Content: ${result.markdown}` : ''}`
              ));
              return {
                content: [
                  {
                    type: 'text',
                    text: resultsText.join('\n\n'),
                  },
                ],
                results,
                success,
              };
            } catch (error) {
              server.sendLoggingMessage({
                level: 'error',
                data: `[${new Date().toISOString()}] Error searching: ${error}`,
              });
              const msg = error instanceof Error ? error.message : 'Unknown error';
              return {
                success: false,
                content: [
                  {
                    type: 'text',
                    text: msg,
                  },
                ],
              };
            }
          }
  • Tool schema defining name, description, and input validation for one_search.
    export const SEARCH_TOOL: Tool = {
      name: 'one_search',
      description:
        'Search and retrieve content from web pages. ' +
        'Returns SERP results by default (url, title, description).',
      inputSchema: {
        type: 'object',
        properties: {
          query: {
            type: 'string',
            description: 'Search query string',
          },
          limit: {
            type: 'number',
            description: 'Maximum number of results to return (default: 10)',
          },
          language: {
            type: 'string',
            description: 'Language code for search results (default: auto)',
          },
          categories: {
            type: 'string',
            enum: [
              'general',
              'news',
              'images',
              'videos',
              'it',
              'science',
              'map',
              'music',
              'files',
              'social_media',
            ],
            description: 'Categories to search for (default: general)',
          },
          timeRange: {
            type: 'string',
            description: 'Time range for search results (default: all)',
            enum: [
              'all',
              'day',
              'week',
              'month',
              'year',
            ],
          },
        },
        required: ['query'],
      },
    };
  • src/index.ts:66-73 (registration)
    Registers the one_search tool (as SEARCH_TOOL) for discovery via listTools.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        SEARCH_TOOL,
        EXTRACT_TOOL,
        SCRAPE_TOOL,
        MAP_TOOL,
      ],
    }));
  • Dispatches search requests to the configured provider (searxng, tavily, bing, duckduckgo, or local).
    async function processSearch(args: ISearchRequestOptions): Promise<ISearchResponse> {
      switch (SEARCH_PROVIDER) {
        case 'searxng': {
          // merge default config with args
          const params = {
            ...searchDefaultConfig,
            ...args,
            apiKey: SEARCH_API_KEY,
          };
    
          // but categories and language have higher priority (ENV > args).
          const { categories, language } = searchDefaultConfig;
    
          if (categories) {
            params.categories = categories;
          }
          if (language) {
            params.language = language;
          }
          return await searxngSearch(params);
        }
        case 'tavily': {
          return await tavilySearch({
            ...searchDefaultConfig,
            ...args,
            apiKey: SEARCH_API_KEY,
          });
        }
        case 'bing': {
          return await bingSearch({
            ...searchDefaultConfig,
            ...args,
            apiKey: SEARCH_API_KEY,
          });
        }
        case 'duckduckgo': {
          const safeSearch = args.safeSearch ?? 0;
          const safeSearchOptions = [SafeSearchType.STRICT, SafeSearchType.MODERATE, SafeSearchType.OFF];
          return await duckDuckGoSearch({
            ...searchDefaultConfig,
            ...args,
            apiKey: SEARCH_API_KEY,
            safeSearch: safeSearchOptions[safeSearch],
          });
        }
        case 'local': {
          return await localSearch({
            ...searchDefaultConfig,
            ...args,
          });
        }
        default:
          throw new Error(`Unsupported search provider: ${SEARCH_PROVIDER}`);
      }
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool returns SERP results by default, which is useful, but lacks critical details such as whether it requires authentication, rate limits, error handling, or pagination behavior for a search tool.

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 sized with two concise sentences that are front-loaded with the core purpose. It avoids redundancy but could be slightly more structured by explicitly separating purpose from output details.

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 search tool with 5 parameters and no output schema, the description is minimally adequate. It covers the basic purpose and default output, but lacks details on error cases, result formatting beyond defaults, or integration with sibling tools, leaving gaps in context.

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%, so the schema fully documents all 5 parameters. The description adds no additional parameter semantics beyond implying search functionality, which is already covered by the schema. This meets the baseline for high 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 the tool's purpose with specific verbs ('search and retrieve') and resource ('content from web pages'), and distinguishes it from siblings by mentioning SERP results. However, it doesn't explicitly differentiate from 'one_extract' or 'one_scrape' which might also retrieve web content.

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 like 'one_extract', 'one_map', or 'one_scrape'. It mentions the default return format but offers no context about use cases, exclusions, or prerequisites.

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/yokingma/one-search-mcp'

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