Skip to main content
Glama
264Gaurav

Weather MCP Server

by 264Gaurav

get_alerts

Retrieve weather alerts for any US state by providing its two-letter code. This tool helps users stay informed about active weather warnings and advisories.

Instructions

Get weather alerts for a US state.

Args: state: Two-letter US state code (e.g. CA, NY)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stateYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'get_alerts' tool. It is decorated with @mcp.tool() for registration and implements the logic to fetch active weather alerts for a given US state using the National Weather Service API, formatting and returning the results.
    @mcp.tool()
    async def get_alerts(state: str) -> str:
        """Get weather alerts for a US state.
    
        Args:
            state: Two-letter US state code (e.g. CA, NY)
        """
        url = f"{NWS_API_BASE}/alerts/active/area/{state}"
        data = await make_nws_request(url)
    
        if not data or "features" not in data:
            return "Unable to fetch alerts or no alerts found."
    
        if not data["features"]:
            return "No active alerts for this state."
    
        alerts = [format_alert(feature) for feature in data["features"]]
        return "\n---\n".join(alerts)
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool retrieves alerts but doesn't disclose behavioral traits like whether this is a read-only operation, rate limits, authentication needs, response format, or error conditions. The description provides basic functionality but lacks critical operational context.

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 perfectly concise with two sentences: one stating the purpose and one explaining the parameter. Both sentences earn their place, and the structure is front-loaded with the core functionality first followed by parameter details.

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 simple single-parameter tool with an output schema (which handles return values), the description covers the essential purpose and parameter semantics well. However, the lack of behavioral transparency (no annotations) means it doesn't fully address operational context for a tool that likely makes external API calls.

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

Parameters5/5

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

With 0% schema description coverage and 1 parameter, the description fully compensates by explaining the 'state' parameter meaning ('Two-letter US state code'), providing examples ('e.g. CA, NY'), and clarifying the geographic constraint ('US state'). This adds significant value beyond the bare schema.

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 as 'Get weather alerts for a US state' with specific verb ('Get') and resource ('weather alerts'), and specifies geographic scope ('US state'). However, with no sibling tools mentioned, there's no opportunity to distinguish from alternatives, preventing 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 Guidelines3/5

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

The description implies usage context by specifying 'for a US state', but provides no explicit guidance on when to use this tool versus alternatives, prerequisites, or exclusions. With no sibling tools, the baseline is adequate but lacks comprehensive guidance.

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/264Gaurav/mcp_ai'

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