Skip to main content
Glama

get_uv_forecast

Retrieve UV index forecasts for Portuguese locations to plan outdoor activities and manage sun exposure risks based on radiation levels.

Instructions

Get UV index forecast for Portugal (Previsão Índice Ultravioleta até 3 dias).

Returns UV radiation index forecast for Portuguese locations.
UV Index levels:
- 0-2: Low
- 3-5: Moderate
- 6-7: High
- 8-10: Very High
- 11+: Extreme

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get_uv_forecast' tool. It is decorated with @mcp.tool() which also serves as registration. Fetches UV index forecast data from the IPMA API using the make_ipma_request helper and returns formatted string output or error message.
    @mcp.tool()
    async def get_uv_forecast() -> str:
        """Get UV index forecast for Portugal (Previsão Índice Ultravioleta até 3 dias).
        
        Returns UV radiation index forecast for Portuguese locations.
        UV Index levels:
        - 0-2: Low
        - 3-5: Moderate
        - 6-7: High
        - 8-10: Very High
        - 11+: Extreme
        """
        uv_url = f"{IPMA_API_BASE}/forecast/meteorology/uv/uv.json"
        uv_data = await make_ipma_request(uv_url)
        
        if not uv_data:
            return """UV index forecast is currently unavailable.
    The IPMA API provides UV radiation index forecasts for up to 3 days.
    
    UV Index levels:
    - 0-2: Low (minimal protection needed)
    - 3-5: Moderate (protection recommended)
    - 6-7: High (protection essential)
    - 8-10: Very High (extra protection required)
    - 11+: Extreme (avoid sun exposure)
    
    Please try again later or check the IPMA website directly."""
        
        # Process UV data based on actual API structure
        if isinstance(uv_data, dict):
            result = "UV Index Forecast\n\n"
            result += str(uv_data)
        else:
            result = "UV Index Forecast\n\n"
            result += str(uv_data)
        
        return result
Behavior3/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 describes the return format (UV index forecast with defined levels) and geographic scope, but lacks details on rate limits, authentication needs, error handling, or data freshness. It adequately covers the core behavior but misses operational constraints.

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 efficiently structured: the first sentence states the purpose, the second clarifies the return, and the subsequent lines provide essential UV index classifications. Every sentence adds value without redundancy, making it easy to scan and understand.

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 simplicity (0 parameters, no annotations, no output schema), the description is nearly complete. It covers purpose, geographic and temporal scope, and output format with detailed UV levels. Minor gaps include lack of information on data sources or update frequency, but overall it provides sufficient context for effective use.

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 input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately focuses on output semantics by explaining the UV index scale and levels, which adds value beyond the schema. This compensates for the lack of an output schema.

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 tool's purpose with specific verb ('Get') and resource ('UV index forecast'), including the geographic scope ('for Portugal') and time horizon ('até 3 dias'). It distinguishes from siblings by focusing exclusively on UV radiation forecasting, unlike other tools that handle weather types, sea conditions, fire risk, or seismic data.

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

Usage Guidelines3/5

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

The description implies usage context through the geographic restriction ('for Portugal') and time frame ('até 3 dias'), suggesting this tool is for UV forecasting in Portugal up to 3 days ahead. However, it does not explicitly state when to use this versus alternatives like 'get_forecast' or 'get_daily_aggregate_forecast', nor does it provide exclusions or prerequisites.

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/gabriel20vieira/ipma-mcp-server'

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