Skip to main content
Glama
KyrieTangSheng

National Parks MCP Server

findParks

Search U.S. national parks by state, name, activities, or other criteria to find parks matching your interests and location.

Instructions

Search for national parks based on state, name, activities, or other criteria

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stateCodeNoFilter parks by state code (e.g., "CA" for California, "NY" for New York). Multiple states can be comma-separated (e.g., "CA,OR,WA")
qNoSearch term to filter parks by name or description
limitNoMaximum number of parks to return (default: 10, max: 50)
startNoStart position for results (useful for pagination)
activitiesNoFilter by available activities (e.g., "hiking,camping")

Implementation Reference

  • The main handler function for the 'findParks' tool. It validates input, calls the NPS API via npsApiClient, formats the data, and returns a JSON string response.
    export async function findParksHandler(args: z.infer<typeof FindParksSchema>) {
      // Validate state codes if provided
      if (args.stateCode) {
        const providedStates = args.stateCode.split(',').map(s => s.trim().toUpperCase());
        const invalidStates = providedStates.filter(state => !STATE_CODES.includes(state));
        
        if (invalidStates.length > 0) {
          return {
            content: [{ 
              type: "text", 
              text: JSON.stringify({
                error: `Invalid state code(s): ${invalidStates.join(', ')}`,
                validStateCodes: STATE_CODES
              })
            }]
          };
        }
      }
      
      // 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.getParks(requestParams);
      
      // Format the response for better readability by the AI
      const formattedParks = formatParkData(response.data);
      
      const result = {
        total: parseInt(response.total),
        limit: parseInt(response.limit),
        start: parseInt(response.start),
        parks: formattedParks
      };
      
      return {
        content: [{ 
          type: "text", 
          text: JSON.stringify(result, null, 2)
        }]
      };
    } 
  • Zod schema defining the input parameters for the findParks tool, including optional filters like stateCode, search query, limit, etc.
    export const FindParksSchema = z.object({
      stateCode: z.string().optional().describe('Filter parks by state code (e.g., "CA" for California, "NY" for New York). Multiple states can be comma-separated (e.g., "CA,OR,WA")'),
      q: z.string().optional().describe('Search term to filter parks by name or description'),
      limit: z.number().optional().describe('Maximum number of parks to return (default: 10, max: 50)'),
      start: z.number().optional().describe('Start position for results (useful for pagination)'),
      activities: z.string().optional().describe('Filter by available activities (e.g., "hiking,camping")')
    });
  • src/server.ts:43-47 (registration)
    Registration of the 'findParks' tool in the ListToolsRequestSchema handler, specifying name, description, and input schema.
    {
      name: "findParks",
      description: "Search for national parks based on state, name, activities, or other criteria",
      inputSchema: zodToJsonSchema(FindParksSchema),
    },
  • src/server.ts:85-88 (registration)
    Dispatch/execution registration for 'findParks' in the CallToolRequestSchema switch statement, parsing args and calling the handler.
    case "findParks": {
      const args = FindParksSchema.parse(request.params.arguments);
      return await findParksHandler(args);
    }
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. It mentions search functionality but fails to describe key traits: whether this is a read-only operation, if it requires authentication, rate limits, pagination behavior (beyond the 'start' parameter in schema), or the format/scope of results. For a search tool with zero annotation coverage, 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 front-loads the core purpose ('Search for national parks') and succinctly lists criteria. There is no wasted text, repetition, or unnecessary elaboration, making it easy for an agent to parse quickly.

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 lack of annotations and output schema, the description is incomplete. It doesn't address behavioral aspects (e.g., safety, performance) or result format, which are critical for a search tool. While the schema covers parameters well, the overall context for agent decision-making is insufficient, especially compared to siblings that may have overlapping domains.

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%, providing detailed documentation for all 5 parameters (e.g., stateCode format, limit defaults, activities filtering). The description adds minimal value beyond the schema, only listing criteria types ('state, name, activities, or other criteria') without explaining syntax or interactions. Baseline 3 is appropriate as the schema does the heavy lifting.

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 ('search') and resource ('national parks'), and specifies the search criteria ('based on state, name, activities, or other criteria'). It distinguishes from siblings like getParkDetails (which retrieves details for a specific park) by focusing on search/filtering. However, it doesn't explicitly contrast with getAlerts or getEvents, which might also involve parks.

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 for searching parks with various filters, but provides no explicit guidance on when to use this tool versus alternatives like getParkDetails (for detailed info on a known park) or getCampgrounds (for campground-specific data). It lacks clear exclusions or prerequisites, leaving the agent to infer context from tool names alone.

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