get_avalanche_bulletin
Retrieve current Swiss avalanche danger bulletins with daily updates, providing danger levels, regional data, and interactive map links for safety planning.
Instructions
Get the current Swiss avalanche danger bulletin from SLF (WSL Institute for Snow and Avalanche Research). Returns current bulletin URLs, danger level descriptions, and links to the interactive map. The bulletin is published daily at ~08:00 and updated at ~17:00 Swiss time (October–May).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| region | No | Optional region ID (e.g. CH-9 for Central Graubünden) or region name. Use list_avalanche_regions to see all options. If omitted, returns national overview. | |
| language | No | Language for bulletin links: de (German), en (English), fr (French), it (Italian). Default: en |
Implementation Reference
- src/modules/avalanche.ts:129-189 (handler)The handler function responsible for executing the 'get_avalanche_bulletin' tool. It constructs bulletin URLs and optional region-specific links.
async function handleGetAvalancheBulletin(args: Record<string, string>): Promise<string> { const lang = SUPPORTED_LANGUAGES.includes(args.language) ? args.language : "en"; const today = todayISO(); // Find matching region if specified let matchedRegion: typeof SWISS_AVALANCHE_REGIONS[0] | undefined; if (args.region) { const query = args.region.trim().toLowerCase(); matchedRegion = SWISS_AVALANCHE_REGIONS.find( (r) => r.id.toLowerCase() === query || r.name.toLowerCase().includes(query) || r.canton.toLowerCase().includes(query) ); } const pdfUrl = bulletinPdfUrl(lang); const mapUrl = whiteRiskUrl(lang); const result: Record<string, unknown> = { date: today, source: "SLF – WSL Institute for Snow and Avalanche Research", bulletin_url: { interactive_map: mapUrl, pdf_full: pdfUrl, pdf_regions: { de: "https://aws.slf.ch/api/bulletin/document/full/de", en: "https://aws.slf.ch/api/bulletin/document/full/en", fr: "https://aws.slf.ch/api/bulletin/document/full/fr", it: "https://aws.slf.ch/api/bulletin/document/full/it", }, }, danger_scale: DANGER_LEVELS, schedule: { morning_bulletin: "~08:00 CET/CEST", afternoon_update: "~17:00 CET/CEST", season: "October to May (daily). Summer bulletins are occasional.", }, note: "The SLF JSON API requires authentication (used by the White Risk app). " + "Current danger levels are available via the interactive map at whiterisk.ch " + "or as PDF bulletins at the URLs above. " + "For programmatic access, contact SLF at lawinfo@slf.ch.", }; if (matchedRegion) { result.region = { id: matchedRegion.id, name: matchedRegion.name, canton: matchedRegion.canton, typical_elevation_m: matchedRegion.elevation_m, bulletin_link: `${mapUrl}#region=${matchedRegion.id}`, }; result.tip = `Check ${matchedRegion.name} (${matchedRegion.id}) on the interactive map: ${mapUrl}`; } else if (args.region) { result.region_not_found = args.region; result.tip = `Use list_avalanche_regions to see valid region IDs. Or visit ${mapUrl} for the full map.`; } return JSON.stringify(result); } - src/modules/avalanche.ts:86-108 (schema)The definition and input schema for the 'get_avalanche_bulletin' tool.
{ name: "get_avalanche_bulletin", description: "Get the current Swiss avalanche danger bulletin from SLF (WSL Institute for Snow and Avalanche Research). " + "Returns current bulletin URLs, danger level descriptions, and links to the interactive map. " + "The bulletin is published daily at ~08:00 and updated at ~17:00 Swiss time (October–May).", inputSchema: { type: "object", properties: { region: { type: "string", description: "Optional region ID (e.g. CH-9 for Central Graubünden) or region name. " + "Use list_avalanche_regions to see all options. If omitted, returns national overview.", }, language: { type: "string", enum: ["de", "en", "fr", "it"], description: "Language for bulletin links: de (German), en (English), fr (French), it (Italian). Default: en", }, }, }, }, - src/modules/avalanche.ts:224-225 (registration)The registration within the main dispatcher where the 'get_avalanche_bulletin' tool is linked to its handler function.
case "get_avalanche_bulletin": return handleGetAvalancheBulletin(args);