Skip to main content
Glama
flyanima

Open Search MCP

by flyanima

search_ecosia

Search the web using Ecosia to find information while supporting tree planting with each query. Specify search terms, result limits, country preferences, and safe search filters.

Instructions

Search using Ecosia - the search engine that plants trees

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query for Ecosia
maxResultsNoMaximum number of results to return (1-20)
countryNoSearch country (e.g., "US", "DE", "FR")US
safeSearchNoEnable safe search filtering

Implementation Reference

  • Main execution handler for the search_ecosia tool. Processes input arguments, calls the Ecosia search client, computes environmental impact metrics like trees planted and CO2 offset, and returns formatted search results or error response.
    execute: async (args: any) => {
      try {
        const { query, maxResults = 10, country = 'US', safeSearch = true } = args;
        
        const startTime = Date.now();
        const result = await client.searchEcosia(query, { maxResults, country, safeSearch });
        const searchTime = Date.now() - startTime;
    
        // 计算环保影响
        const treesPlanted = Math.floor(maxResults * 0.02); // 大约每50次搜索种一棵树
        const co2Offset = Math.round(treesPlanted * 22); // 每棵树每年吸收约22kg CO2
    
        return {
          success: true,
          data: {
            source: 'Ecosia',
            query,
            country,
            safeSearch,
            totalResults: result.results.length,
            results: result.results,
            searchTime,
            timestamp: Date.now(),
            environmental: result.environmental,
            features: result.features,
            impact: {
              treesPlanted,
              co2Offset: `${co2Offset}kg CO2/year`,
              renewableEnergy: '100%'
            },
            searchMetadata: {
              engine: 'Ecosia',
              environmental: true,
              carbonNeutral: true,
              treePlanting: true
            }
          }
        };
      } catch (error) {
        return {
          success: false,
          error: error instanceof Error ? error.message : 'Ecosia search failed',
          data: {
            source: 'Ecosia',
            query: args.query,
            results: [],
            suggestions: [
              'Try eco-friendly search terms',
              'Support environmental causes',
              'Use sustainable search practices'
            ]
          }
        };
      }
  • Input schema for search_ecosia tool defining required 'query' string and optional parameters: maxResults (1-20), country (default 'US'), safeSearch boolean (default true).
    inputSchema: {
      type: 'object',
      properties: {
        query: {
          type: 'string',
          description: 'Search query for Ecosia'
        },
        maxResults: {
          type: 'number',
          description: 'Maximum number of results to return (1-20)',
          default: 10,
          minimum: 1,
          maximum: 20
        },
        country: {
          type: 'string',
          description: 'Search country (e.g., "US", "DE", "FR")',
          default: 'US'
        },
        safeSearch: {
          type: 'boolean',
          description: 'Enable safe search filtering',
          default: true
        }
      },
      required: ['query']
  • Primary registration of the search_ecosia tool in the AlternativeSearchEngines module, including name, description, category, source, inputSchema, and execute handler.
    registry.registerTool({
      name: 'search_ecosia',
      description: 'Search using Ecosia - the search engine that plants trees',
      category: 'search',
      source: 'Ecosia',
      inputSchema: {
        type: 'object',
        properties: {
          query: {
            type: 'string',
            description: 'Search query for Ecosia'
          },
          maxResults: {
            type: 'number',
            description: 'Maximum number of results to return (1-20)',
            default: 10,
            minimum: 1,
            maximum: 20
          },
          country: {
            type: 'string',
            description: 'Search country (e.g., "US", "DE", "FR")',
            default: 'US'
          },
          safeSearch: {
            type: 'boolean',
            description: 'Enable safe search filtering',
            default: true
          }
        },
        required: ['query']
      },
      execute: async (args: any) => {
        try {
          const { query, maxResults = 10, country = 'US', safeSearch = true } = args;
          
          const startTime = Date.now();
          const result = await client.searchEcosia(query, { maxResults, country, safeSearch });
          const searchTime = Date.now() - startTime;
    
          // 计算环保影响
          const treesPlanted = Math.floor(maxResults * 0.02); // 大约每50次搜索种一棵树
          const co2Offset = Math.round(treesPlanted * 22); // 每棵树每年吸收约22kg CO2
    
          return {
            success: true,
            data: {
              source: 'Ecosia',
              query,
              country,
              safeSearch,
              totalResults: result.results.length,
              results: result.results,
              searchTime,
              timestamp: Date.now(),
              environmental: result.environmental,
              features: result.features,
              impact: {
                treesPlanted,
                co2Offset: `${co2Offset}kg CO2/year`,
                renewableEnergy: '100%'
              },
              searchMetadata: {
                engine: 'Ecosia',
                environmental: true,
                carbonNeutral: true,
                treePlanting: true
              }
            }
          };
        } catch (error) {
          return {
            success: false,
            error: error instanceof Error ? error.message : 'Ecosia search failed',
            data: {
              source: 'Ecosia',
              query: args.query,
              results: [],
              suggestions: [
                'Try eco-friendly search terms',
                'Support environmental causes',
                'Use sustainable search practices'
              ]
            }
          };
        }
      }
    });
  • Helper method in AlternativeSearchClient that performs the core Ecosia search logic using generateSearchResults to produce mock results with environmental metadata.
    async searchEcosia(query: string, options: any = {}) {
      try {
        // Ecosia是环保搜索引擎,我们使用模拟数据
        const results = this.generateSearchResults(query, 'Ecosia', options.maxResults || 10);
        return {
          success: true,
          results,
          source: 'Ecosia',
          environmental: 'Plants trees with search revenue',
          features: ['Carbon neutral', 'Tree planting', 'Renewable energy']
        };
      } catch (error) {
        throw new Error(`Ecosia search failed: ${error instanceof Error ? error.message : String(error)}`);
      }
  • src/index.ts:241-241 (registration)
    Top-level registration call in OpenSearchMCPServer.registerAllTools() that invokes the registerAlternativeSearchEngines function, which registers search_ecosia among others.
    registerAlternativeSearchEngines(this.toolRegistry); // 3 tools: search_startpage, search_brave, search_ecosia
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 only mentions that Ecosia plants trees, which is a brand feature, not a behavioral trait. It doesn't describe what the tool returns (e.g., search results format), rate limits, authentication needs, or error handling. This leaves significant gaps for a search tool with no output schema.

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 directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, with zero waste. Every part of the sentence earns its place by conveying essential information.

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?

Given the tool's complexity (a search operation with 4 parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns, how results are structured, or any behavioral aspects like pagination or errors. For a search tool with no structured output documentation, this is a significant gap.

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 already documents all four parameters (query, maxResults, country, safeSearch) with descriptions, defaults, and constraints. The description adds no additional parameter semantics beyond what's in the schema, such as examples or edge cases. Baseline 3 is appropriate when the schema does the heavy lifting.

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: 'Search using Ecosia - the search engine that plants trees.' It specifies the verb ('Search') and resource ('Ecosia'), and distinguishes it from siblings by mentioning Ecosia's unique tree-planting aspect. However, it doesn't explicitly differentiate from other search tools like search_brave or search_searx beyond the Ecosia branding.

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. It doesn't mention any specific use cases, prerequisites, or comparisons with sibling search tools like search_arxiv or search_pubmed. The agent must infer usage from the tool name 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/flyanima/open-search-mcp'

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