Skip to main content
Glama
remoprinz

Swiss Health MCP Server

get_database_stats

Retrieve database statistics including entry counts, available years, and insurers to understand the scope of Swiss health insurance premium data for analysis.

Instructions

Zeigt Statistiken zur Datenbank (Anzahl Einträge, verfügbare Jahre, Versicherer).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that executes the tool logic. It queries the Supabase database for counts of premiums, insurers, and locations; determines available years by checking counts per year; computes unique insurers from premiums; and formats statistics into a markdown-like string response.
    async function getDatabaseStats(): Promise<string> {
      const db = getSupabase();
    
      // Hole Statistiken
      const [premiumsCount, insurersCount, locationsCount] = await Promise.all([
        db.from("premiums").select("*", { count: "exact", head: true }),
        db.from("insurers").select("*", { count: "exact", head: true }),
        db.from("locations").select("*", { count: "exact", head: true })
      ]);
    
      // Prüfe welche Jahre Daten haben (effizienter als alle Zeilen zu holen)
      const yearsToCheck = [2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026];
      const yearChecks = await Promise.all(
        yearsToCheck.map(year => 
          db.from("premiums").select("year", { count: "exact", head: true }).eq("year", year)
        )
      );
      
      const availableYears = yearsToCheck.filter((year, index) => 
        yearChecks[index].count && yearChecks[index].count > 0
      );
    
      // Hole Anzahl unique Versicherer aus premiums (statt insurers-Tabelle)
      const { data: insurerSample } = await db
        .from("premiums")
        .select("insurer_id")
        .limit(10000);
      
      const uniqueInsurers = new Set(insurerSample?.map(p => p.insurer_id) || []);
    
      let result = `📊 Datenbank-Statistiken\n\n`;
      result += `📋 Tabellen:\n`;
      result += `   • premiums: ${premiumsCount.count?.toLocaleString("de-CH")} Einträge\n`;
      result += `   • insurers: ${uniqueInsurers.size} aktive Versicherer\n`;
      result += `   • locations: ${locationsCount.count?.toLocaleString("de-CH")} PLZ-Einträge\n\n`;
      result += `📅 Verfügbare Jahre: ${availableYears.join(", ")}\n\n`;
      result += `🔗 Datenquelle: BAG Priminfo (priminfo.admin.ch)\n`;
    
      return result;
    }
  • The input schema definition for the tool, specifying no required parameters (empty object).
    inputSchema: {
      type: "object" as const,
      properties: {},
      required: []
    }
  • src/index.ts:190-199 (registration)
    Tool registration in the TOOLS array used for listing available tools via ListToolsRequestHandler.
      {
        name: "get_database_stats",
        description: "Zeigt Statistiken zur Datenbank (Anzahl Einträge, verfügbare Jahre, Versicherer).",
        inputSchema: {
          type: "object" as const,
          properties: {},
          required: []
        }
      }
    ];
  • src/index.ts:504-506 (registration)
    Registration in the switch statement of the CallToolRequestHandler that dispatches execution to the handler function.
    case "get_database_stats":
      result = await getDatabaseStats();
      break;
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 states the tool shows statistics, implying a read-only operation, but doesn't clarify whether it requires authentication, has rate limits, returns real-time or cached data, or what format the output takes. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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 and lists the statistics it provides. It's appropriately sized and front-loaded with the core functionality, with no wasted words or unnecessary elaboration.

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?

Given the tool's complexity (simple read operation with no parameters), no annotations, and no output schema, the description is minimally adequate. It specifies what statistics are returned, which helps compensate for the lack of output schema, but doesn't address behavioral aspects like authentication or data freshness. For a no-parameter tool, it's complete enough to understand the basic purpose.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100% (since there are no parameters to describe). With no parameters, the description doesn't need to add parameter semantics beyond what the schema provides. The baseline for 0 parameters is 4, as there's nothing to compensate for.

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 Statistiken zur Datenbank' (shows database statistics) and specifies what statistics are included: 'Anzahl Einträge, verfügbare Jahre, Versicherer' (number of entries, available years, insurers). This is a specific verb+resource combination, though it doesn't explicitly differentiate from sibling tools like get_price_history which might also provide statistical 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 or get_cheapest_insurers, nor does it specify contexts where database statistics are needed versus other data retrieval operations. Usage is implied but not explicitly stated.

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