Skip to main content
Glama

get_weather_warnings

Retrieve active weather warnings for Portugal to monitor hazardous conditions and plan accordingly using official meteorological data.

Instructions

Obter avisos meteorológicos ativos em Portugal

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that fetches active weather warnings from the IPMA API endpoint and formats them into a text response.
    async getWeatherWarnings() {
      try {
        const response = await fetch(`${this.baseUrl}/forecast/warnings/warnings_www.json`);
        const data = await response.json();
    
        if (!Array.isArray(data) || data.length === 0) {
          return {
            content: [
              {
                type: "text",
                text: "Não há avisos meteorológicos ativos no momento."
              }
            ]
          };
        }
    
        let result = "**Avisos Meteorológicos Ativos**\n\n";
        
        data.forEach((warning) => {
          const startDate = new Date(warning.startTime).toLocaleString('pt-PT');
          const endDate = new Date(warning.endTime).toLocaleString('pt-PT');
          
          result += `**${warning.awarenessTypeName}**\n`;
          result += `Área: ${warning.idAreaAviso}\n`;
          result += `Nível: ${warning.awarenessLevelID}\n`;
          result += `De: ${startDate}\n`;
          result += `Até: ${endDate}\n`;
          if (warning.text) {
            result += `Detalhes: ${warning.text}\n`;
          }
          result += "\n";
        });
    
        return {
          content: [
            {
              type: "text",
              text: result
            }
          ]
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        throw new McpError(ErrorCode.InternalError, `Erro ao obter avisos: ${errorMessage}`);
      }
    }
  • Tool schema registration including name, description, and input schema (no required parameters).
    {
      name: "get_weather_warnings",
      description: "Obter avisos meteorológicos ativos em Portugal",
      inputSchema: {
        type: "object",
        properties: {}
      }
    },
  • src/index.js:110-111 (registration)
    Registration in the tool dispatcher switch statement that routes calls to the getWeatherWarnings handler.
    case "get_weather_warnings":
      return await this.getWeatherWarnings();
Behavior2/5

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

With no annotations provided, the description carries full burden but provides minimal behavioral information. It doesn't disclose whether this is a read-only operation (implied by 'get'), what data format is returned, whether there are rate limits, authentication requirements, or how current the warning data is. The description states the basic purpose but lacks operational context needed for effective tool use.

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?

Perfectly concise single sentence in Portuguese that communicates the essential purpose: get active weather warnings in Portugal. No wasted words, no redundant information, and front-loaded with the core action. The structure is optimal for a simple tool with no parameters.

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 no annotations, no output schema, and a simple zero-parameter design, the description is insufficiently complete. It doesn't explain what format the warnings come in (text, codes, severity levels), whether it returns all warnings or needs filtering, temporal aspects (how 'active' is defined), or error conditions. For a weather warning tool where users need to understand the nature and format of warnings, this leaves significant gaps.

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 zero parameters with 100% schema description coverage, so the schema fully documents the parameter situation. The description appropriately doesn't discuss parameters since none exist. It earns a 4 rather than 5 because while it correctly avoids parameter discussion, it doesn't explicitly state 'no parameters required' which could help clarify the zero-parameter design.

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 verb ('Obter' meaning 'Get') and resource ('avisos meteorológicos ativos' meaning 'active weather warnings') with geographic scope ('em Portugal' meaning 'in Portugal'). It distinguishes from siblings like get_weather_forecast (forecasts vs warnings) and get_seismic_data (different hazard type). However, it doesn't specify whether it returns all warnings or filtered subsets, which prevents a perfect score.

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?

No explicit guidance on when to use this tool versus alternatives. The description implies it's for active warnings in Portugal, but doesn't clarify when to choose this over get_weather_forecast (which might include warning information) or get_seismic_data (for different hazard types). No mention of prerequisites, frequency of updates, or limitations.

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/brandao-20/mcp_server_ipma'

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