Skip to main content
Glama
remoprinz

Swiss Health MCP Server

get_price_history

Track Swiss health insurance premium changes over time by insurer, canton, age group, and franchise amount to analyze cost trends and make informed coverage decisions.

Instructions

Zeigt die Preisentwicklung eines Versicherers über mehrere Jahre.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
insurer_nameYesName des Versicherers (z.B. 'CSS', 'Helsana')
cantonYesKanton (2-Buchstaben-Code)
age_bandYesAltersgruppe
franchise_chfYesFranchise in CHF
start_yearNoStartjahr (optional, default: 2016)
end_yearNoEndjahr (optional, default: 2026)

Implementation Reference

  • The core handler function that executes the get_price_history tool logic. It resolves insurer IDs, queries the Supabase database for premiums across specified years, selects the cheapest premium per year, formats the price history output, and includes a percentage change calculation.
    async function getPriceHistory(params: {
      insurer_name: string;
      canton: string;
      age_band: string;
      franchise_chf: number;
      start_year?: number;
      end_year?: number;
    }): Promise<string> {
      const db = getSupabase();
      
      const { insurer_name, canton, age_band, franchise_chf, start_year = 2016, end_year = 2026 } = params;
    
      // Finde ALLE Versicherer-IDs (z.B. CSS hat 0008 und 1507)
      const insurerIds = findAllInsurerIds(insurer_name);
      const primaryId = findInsurerIdByName(insurer_name);
    
      if (insurerIds.length === 0 || !primaryId) {
        return `⚠️ Versicherer "${insurer_name}" nicht gefunden\n\nVerfügbare Versicherer: CSS, Helsana, Swica, Assura, Concordia, Sanitas, KPT, ÖKK, Visana, Groupe Mutuel, Sympany, Atupri, EGK, Aquilana, Galenos`;
      }
    
      const insurerDisplayName = getInsurerName(primaryId);
    
      // Hole Prämien über die Jahre für ALLE IDs des Versicherers
      const { data: premiums, error } = await db
        .from("premiums")
        .select("year, monthly_premium_chf, model_type, insurer_id")
        .in("insurer_id", insurerIds)
        .eq("canton", canton.toUpperCase())
        .eq("age_band", age_band)
        .eq("franchise_chf", franchise_chf)
        .gte("year", start_year)
        .lte("year", end_year)
        .order("year", { ascending: true });
    
      if (error || !premiums || premiums.length === 0) {
        return `❌ Keine Daten für ${insurerDisplayName} in ${canton} (IDs: ${insurerIds.join(", ")})`;
      }
    
      // Gruppiere nach Jahr (günstigster Tarif pro Jahr)
      const bestByYear = new Map<number, number>();
      for (const p of premiums) {
        const existing = bestByYear.get(p.year);
        if (!existing || p.monthly_premium_chf < existing) {
          bestByYear.set(p.year, p.monthly_premium_chf);
        }
      }
    
      // Formatiere Ergebnis
      let result = `📈 Preisentwicklung: ${insurerDisplayName}\n`;
      result += `📍 ${canton} | ${age_band} | CHF ${franchise_chf} Franchise\n\n`;
    
      const sortedYears = [...bestByYear.entries()].sort((a, b) => a[0] - b[0]);
      sortedYears.forEach(([year, premium]) => {
        result += `${year}: CHF ${premium.toFixed(2)}/Monat\n`;
      });
    
      if (sortedYears.length >= 2) {
        const first = sortedYears[0][1];
        const last = sortedYears[sortedYears.length - 1][1];
        const change = ((last - first) / first * 100).toFixed(1);
        result += `\n📊 Veränderung ${sortedYears[0][0]}-${sortedYears[sortedYears.length - 1][0]}: ${change}%\n`;
      }
    
      result += DISCLAIMER;
      return result;
    }
  • Input schema definition for the get_price_history tool, specifying parameters, types, descriptions, enums, and required fields.
    inputSchema: {
      type: "object" as const,
      properties: {
        insurer_name: { type: "string", description: "Name des Versicherers (z.B. 'CSS', 'Helsana')" },
        canton: { type: "string", description: "Kanton (2-Buchstaben-Code)" },
        age_band: { type: "string", enum: ["child", "young_adult", "adult"], description: "Altersgruppe" },
        franchise_chf: { type: "number", description: "Franchise in CHF" },
        start_year: { type: "number", description: "Startjahr (optional, default: 2016)" },
        end_year: { type: "number", description: "Endjahr (optional, default: 2026)" }
      },
      required: ["insurer_name", "canton", "age_band", "franchise_chf"]
    }
  • src/index.ts:174-189 (registration)
    Tool registration object in the TOOLS array, which is returned by the ListToolsRequestHandler. Includes name, description, and input schema.
    {
      name: "get_price_history",
      description: "Zeigt die Preisentwicklung eines Versicherers über mehrere Jahre.",
      inputSchema: {
        type: "object" as const,
        properties: {
          insurer_name: { type: "string", description: "Name des Versicherers (z.B. 'CSS', 'Helsana')" },
          canton: { type: "string", description: "Kanton (2-Buchstaben-Code)" },
          age_band: { type: "string", enum: ["child", "young_adult", "adult"], description: "Altersgruppe" },
          franchise_chf: { type: "number", description: "Franchise in CHF" },
          start_year: { type: "number", description: "Startjahr (optional, default: 2016)" },
          end_year: { type: "number", description: "Endjahr (optional, default: 2026)" }
        },
        required: ["insurer_name", "canton", "age_band", "franchise_chf"]
      }
    },
  • src/index.ts:501-503 (registration)
    Dispatch/registration case in the switch statement of the CallToolRequestHandler that invokes the getPriceHistory handler when the tool name matches.
    case "get_price_history":
      result = await getPriceHistory(args as any);
      break;
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a read operation ('zeigt' - shows) which implies non-destructive behavior, but doesn't address other important aspects like authentication requirements, rate limits, error conditions, response format, or whether it returns historical data points or aggregated trends. For a tool with 6 parameters and no output schema, this is insufficient.

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 in German that directly states the tool's purpose without unnecessary words. It's appropriately sized for a straightforward data retrieval tool and front-loads the core functionality.

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?

For a tool with 6 parameters, no annotations, and no output schema, the description is incomplete. While concise, it doesn't compensate for the lack of structured metadata by explaining what the tool returns (historical price points? percentage changes? annual premiums?), how results are formatted, or important behavioral constraints. The agent would need to guess about the output structure and operational characteristics.

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 description doesn't add any parameter-specific information beyond what's already in the schema (which has 100% coverage). It mentions 'Versicherers' (insurer) which aligns with the 'insurer_name' parameter and 'mehrere Jahre' (several years) which relates to the temporal parameters, but provides no additional context about parameter relationships, constraints, or usage patterns. With complete 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's purpose: 'Zeigt die Preisentwicklung eines Versicherers über mehrere Jahre' (Shows the price development of an insurer over several years). It specifies the verb 'zeigt' (shows) and resource 'Preisentwicklung' (price development) with temporal scope 'über mehrere Jahre' (over several years). However, it doesn't explicitly differentiate from sibling tools like 'compare_insurers' or 'get_cheapest_insurers' which might also involve price data.

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 sibling tools like 'compare_insurers' (for comparing multiple insurers) or 'get_cheapest_insurers' (for finding cheapest options), nor does it specify prerequisites or exclusions. Usage context is implied but not explicit.

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

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