Skip to main content
Glama
KyrieTangSheng

National Parks MCP Server

getEvents

Find upcoming events at U.S. National Parks by filtering by park, date range, or search terms to discover activities and programs.

Instructions

Find upcoming events at parks

Input Schema

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

Implementation Reference

  • The main handler function getEventsHandler that implements the core tool logic: processes arguments, fetches events from NPS API, formats and groups data by park, returns JSON response.
    export async function getEventsHandler(args: z.infer<typeof GetEventsSchema>) {
      // 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.getEvents(requestParams);
      
      // Format the response for better readability by the AI
      const formattedEvents = formatEventData(response.data);
      
      // Group events by park code for better organization
      const eventsByPark: { [key: string]: any[] } = {};
      formattedEvents.forEach(event => {
        if (!eventsByPark[event.parkCode]) {
          eventsByPark[event.parkCode] = [];
        }
        eventsByPark[event.parkCode].push(event);
      });
      
      const result = {
        total: parseInt(response.total),
        limit: parseInt(response.limit),
        start: parseInt(response.start),
        events: formattedEvents,
        eventsByPark: eventsByPark
      };
      
      return {
        content: [{ 
          type: "text", 
          text: JSON.stringify(result, null, 2)
        }]
      };
    } 
  • Zod input schema for the getEvents tool defining optional parameters: parkCode, limit, start, dateStart, dateEnd, q.
    export const GetEventsSchema = z.object({
      parkCode: z.string().optional().describe('Filter events 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 events to return (default: 10, max: 50)'),
      start: z.number().optional().describe('Start position for results (useful for pagination)'),
      dateStart: z.string().optional().describe('Start date for filtering events (format: YYYY-MM-DD)'),
      dateEnd: z.string().optional().describe('End date for filtering events (format: YYYY-MM-DD)'),
      q: z.string().optional().describe('Search term to filter events by title or description')
    }); 
  • src/server.ts:69-72 (registration)
    Registration of the getEvents tool in the ListToolsRequestHandler response, specifying name, description, and input schema.
      name: "getEvents",
      description: "Find upcoming events at parks",
      inputSchema: zodToJsonSchema(GetEventsSchema),
    },
  • src/server.ts:110-113 (registration)
    Execution handler in CallToolRequestHandler switch statement: parses arguments using GetEventsSchema and delegates to getEventsHandler.
    case "getEvents": {
      const args = GetEventsSchema.parse(request.params.arguments);
      return await getEventsHandler(args);
    }
  • NPS API client helper method that fetches events data from the '/events' NPS API endpoint.
    async getEvents(params: EventQueryParams = {}): Promise<NPSResponse<EventData>> {
      try {
        const response = await this.api.get('/events', { params });
        return response.data;
      } catch (error) {
        console.error('Error fetching events data:', error);
        throw error;
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'Find' suggests a read-only operation, it doesn't specify permissions, rate limits, pagination behavior beyond the 'start' parameter, or what the return format looks like (e.g., list of events with details). For a tool with 6 parameters and no annotations, this leaves significant gaps in understanding its behavior.

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 a single, efficient sentence that directly states the tool's purpose without any wasted words. It is appropriately sized and front-loaded, making it easy to grasp immediately.

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 the complexity of 6 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain return values, error handling, or behavioral traits like pagination or filtering nuances, leaving the agent with insufficient context to use the tool effectively beyond basic parameter input.

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?

The input schema has 100% description coverage, providing clear details for all 6 parameters (e.g., parkCode format, limit defaults, date formats). The description adds no additional parameter semantics beyond what's in the schema, so it meets the baseline of 3 for adequate but not enhanced coverage.

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 action ('Find') and target resource ('upcoming events at parks'), which is specific and understandable. However, it doesn't differentiate this tool from potential sibling tools like 'getAlerts' or 'getCampgrounds' that might also involve park-related queries, missing an opportunity for clearer distinction.

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 like 'findParks' or 'getParkDetails', nor does it mention prerequisites or exclusions. It implies usage for finding events but lacks explicit context about when this is the appropriate choice among the available tools.

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