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

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