Skip to main content
Glama

search_dams

Search Swiss dams and reservoirs under federal supervision by name to find details like dam type, height, reservoir volume, purpose, and construction year. Uses official Swiss Federal Office of Energy data.

Instructions

Search Swiss dams and reservoirs under federal supervision by name. Searches both dam names and reservoir names. Returns dam type, height, crest length, reservoir volume, purpose, canton, and year built. Data source: Swiss Federal Office of Energy (SFOE) via swisstopo BGDI.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesDam or reservoir name to search (e.g. 'Grimsel', 'Grande Dixence', 'Mattmark', 'Lac des Dix'). Partial names are supported.

Implementation Reference

  • The handler for the "search_dams" tool, which processes the user's query, fetches matching dam data, and formats it for output.
    case "search_dams": {
      const query = args.query as string;
      if (!query?.trim()) {
        throw new Error("query is required");
      }
    
      // Try damname first, fall back to reservoirname if no results
      let results = await findDams(query, "damname");
      if (!results.length) {
        results = await findDams(query, "reservoirname");
      }
    
      if (!results.length) {
        return JSON.stringify({
          results: [],
          count: 0,
          message: `No dams found matching "${query}". Try a shorter search term or reservoir name.`,
          source: `${BASE}/find?layer=${DAMS_LAYER}`,
        }, null, 2);
      }
    
      // For up to 5 results, resolve canton via coordinate identify
      const enriched = await Promise.all(
        results.slice(0, MAX_RESULTS).map(async (dam) => {
          let canton: string | null = null;
          if (dam.geometry?.x != null && dam.geometry?.y != null) {
            canton = await fetchCantonForCoords(dam.geometry.x, dam.geometry.y).catch(() => null);
          }
          return formatDamSummary(dam, canton);
        })
      );
    
      const response = {
        results: enriched,
        count: enriched.length,
        total_found: results.length,
        source: `${BASE}/find?layer=${DAMS_LAYER}`,
      };
    
      const json = JSON.stringify(response, null, 2);
      if (json.length > 49000) {
        return JSON.stringify({
          results: enriched.slice(0, 10),
          count: 10,
          total_found: results.length,
          truncated: true,
          source: `${BASE}/find?layer=${DAMS_LAYER}`,
        }, null, 2);
      }
      return json;
    }
  • The definition of the "search_dams" tool, including its name, description, and input schema.
    {
      name: "search_dams",
      description:
        "Search Swiss dams and reservoirs under federal supervision by name. Searches both dam names and reservoir names. Returns dam type, height, crest length, reservoir volume, purpose, canton, and year built. Data source: Swiss Federal Office of Energy (SFOE) via swisstopo BGDI.",
      inputSchema: {
        type: "object",
        required: ["query"],
        properties: {
          query: {
            type: "string",
            description:
              "Dam or reservoir name to search (e.g. 'Grimsel', 'Grande Dixence', 'Mattmark', 'Lac des Dix'). Partial names are supported.",
          },
        },
      },
    },
Behavior4/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 effectively describes key behaviors: it searches both dam and reservoir names, supports partial name matching (implied by 'Partial names are supported' in schema), returns specific attributes (dam type, height, etc.), and cites the data source (SFOE via swisstopo BGDI). It does not mention rate limits, authentication needs, or pagination, but covers the core operational behavior well.

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 front-loaded with the core purpose in the first sentence, followed by additional useful context (search scope, return fields, data source). Every sentence adds value without redundancy, making it efficient and well-structured for an AI agent.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (search with one parameter), no annotations, and no output schema, the description is reasonably complete. It explains what the tool does, what it returns, and the data source. However, it lacks details on output format (e.g., JSON structure) or error handling, which could be helpful for an agent invoking it.

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 schema description coverage is 100%, with the 'query' parameter fully documented in the schema itself. The description adds minimal value beyond the schema, only reiterating that it searches 'by name' without providing additional syntax or format details. This meets the baseline of 3 for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('search'), resource ('Swiss dams and reservoirs under federal supervision'), and scope ('by name'). It explicitly distinguishes this tool from sibling tools like 'get_dam_details' and 'get_dams_by_canton' by specifying it searches both dam and reservoir names, unlike those which appear to retrieve specific details or filter by canton.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool: to search dams/reservoirs by name. It implicitly suggests alternatives by mentioning sibling tools like 'get_dam_details' (for detailed info on a specific dam) and 'get_dams_by_canton' (for filtering by location). However, it does not explicitly state when NOT to use this tool or compare it directly to all alternatives.

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/vikramgorla/mcp-swiss'

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