Skip to main content
Glama
KyrieTangSheng

National Parks MCP Server

getAlerts

Retrieve current national park alerts for closures, hazards, and important safety information to plan visits safely.

Instructions

Get current alerts for national parks including closures, hazards, and important information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
parkCodeNoFilter alerts by park code (e.g., "yose" for Yosemite). Multiple parks can be comma-separated (e.g., "yose,grca").
limitNoMaximum number of alerts to return (default: 10, max: 50)
startNoStart position for results (useful for pagination)
qNoSearch term to filter alerts by title or description

Implementation Reference

  • The main getAlerts tool handler: sets limit, calls NPS API for alerts, formats data, groups by park, returns structured JSON response.
    export async function getAlertsHandler(args: z.infer<typeof GetAlertsSchema>) {
      // Set default limit if not provided or if it exceeds maximum
      const limit = args.limit ? Math.min(args.limit, 50) : 10;
      
      // Format the request parameters
      const requestParams = {
        limit,
        ...args
      };
      
      const response = await npsApiClient.getAlerts(requestParams);
      
      // Format the response for better readability by the AI
      const formattedAlerts = formatAlertData(response.data);
      
      // Group alerts by park code for better organization
      const alertsByPark: { [key: string]: any[] } = {};
      formattedAlerts.forEach(alert => {
        if (!alertsByPark[alert.parkCode]) {
          alertsByPark[alert.parkCode] = [];
        }
        alertsByPark[alert.parkCode].push(alert);
      });
      
      const result = {
        total: parseInt(response.total),
        limit: parseInt(response.limit),
        start: parseInt(response.start),
        alerts: formattedAlerts,
        alertsByPark
      };
      
      return {
        content: [{ 
          type: "text", 
          text: JSON.stringify(result, null, 2)
        }]
      };
    } 
  • Zod input schema for getAlerts tool defining optional parameters: parkCode, limit, start, q.
    export const GetAlertsSchema = z.object({
      parkCode: z.string().optional().describe('Filter alerts by park code (e.g., "yose" for Yosemite). Multiple parks can be comma-separated (e.g., "yose,grca").'),
      limit: z.number().optional().describe('Maximum number of alerts to return (default: 10, max: 50)'),
      start: z.number().optional().describe('Start position for results (useful for pagination)'),
      q: z.string().optional().describe('Search term to filter alerts by title or description')
    });
  • src/server.ts:53-57 (registration)
    Tool registration in ListTools handler: defines name, description, and converts Zod schema to JSON schema for tool metadata.
    {
      name: "getAlerts",
      description: "Get current alerts for national parks including closures, hazards, and important information",
      inputSchema: zodToJsonSchema(GetAlertsSchema),
    },
  • src/server.ts:95-98 (registration)
    Tool dispatch in CallToolRequest handler: parses arguments using schema and invokes getAlertsHandler.
    case "getAlerts": {
      const args = GetAlertsSchema.parse(request.params.arguments);
      return await getAlertsHandler(args);
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a 'Get' operation (implying read-only) but doesn't disclose important behavioral traits like whether it requires authentication, rate limits, pagination behavior beyond the 'start' parameter, or what format the alerts are returned in. The description is too minimal for a tool with 4 parameters and no output schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the core purpose upfront. There's no wasted verbiage or unnecessary elaboration. However, it could be slightly more structured by separating purpose from content types for better readability.

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?

For a tool with 4 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what 'current' means (real-time? cached?), doesn't describe the return format or structure, and provides minimal behavioral context. The description should do more to compensate for the lack of structured metadata.

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

Parameters3/5

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

Schema description coverage is 100%, so all parameters are documented in the schema. The description adds no parameter-specific information beyond what's in the schema - it doesn't explain relationships between parameters or provide usage examples. With complete schema coverage, the baseline is 3 even without additional param info in the description.

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 'Get' and resource 'current alerts for national parks' with specific content types 'closures, hazards, and important information'. It distinguishes from sibling tools like getParkDetails or getEvents by focusing on alerts rather than general park information or events. However, it doesn't explicitly differentiate from all siblings (e.g., getCampgrounds is clearly different).

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when alerts might be needed (e.g., for trip planning, safety checks) or when other tools like getParkDetails might be more appropriate for general information. There's no explicit when/when-not guidance or named alternatives.

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/KyrieTangSheng/mcp-server-nationalparks'

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