Skip to main content
Glama
KyrieTangSheng

National Parks MCP Server

getVisitorCenters

Find visitor center details and operating hours for U.S. National Parks using park codes or search terms.

Instructions

Get information about visitor centers and their operating hours

Input Schema

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

Implementation Reference

  • The main handler function that executes the getVisitorCenters tool logic. It processes input arguments, calls the NPS API client to fetch visitor centers data, formats the response, groups by park, and returns a structured JSON response.
    export async function getVisitorCentersHandler(args: z.infer<typeof GetVisitorCentersSchema>) {
      // 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.getVisitorCenters(requestParams);
      
      // Format the response for better readability by the AI
      const formattedCenters = formatVisitorCenterData(response.data);
      
      // Group visitor centers by park code for better organization
      const centersByPark: { [key: string]: any[] } = {};
      formattedCenters.forEach(center => {
        if (!centersByPark[center.parkCode]) {
          centersByPark[center.parkCode] = [];
        }
        centersByPark[center.parkCode].push(center);
      });
      
      const result = {
        total: parseInt(response.total),
        limit: parseInt(response.limit),
        start: parseInt(response.start),
        visitorCenters: formattedCenters,
        visitorCentersByPark: centersByPark
      };
      
      return {
        content: [{ 
          type: "text", 
          text: JSON.stringify(result, null, 2)
        }]
      };
    } 
  • Zod schema defining the input parameters for the getVisitorCenters tool, including optional filters for park code, limit, start, and search query.
    export const GetVisitorCentersSchema = z.object({
      parkCode: z.string().optional().describe('Filter visitor centers 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 visitor centers 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 visitor centers by name or description')
    });
  • src/server.ts:58-62 (registration)
    Tool registration in the ListToolsRequestHandler, defining the tool's name, description, and input schema for discovery.
    {
      name: "getVisitorCenters",
      description: "Get information about visitor centers and their operating hours",
      inputSchema: zodToJsonSchema(GetVisitorCentersSchema),
    },
  • src/server.ts:100-103 (registration)
    Dispatch logic in the CallToolRequestHandler switch statement that parses arguments and calls the getVisitorCentersHandler.
    case "getVisitorCenters": {
      const args = GetVisitorCentersSchema.parse(request.params.arguments);
      return await getVisitorCentersHandler(args);
    }
  • NPS API client method that makes the HTTP request to the /visitorcenters endpoint to fetch raw visitor centers data.
    async getVisitorCenters(params: VisitorCenterQueryParams = {}): Promise<NPSResponse<VisitorCenterData>> {
      try {
        const response = await this.api.get('/visitorcenters', { params });
        return response.data;
      } catch (error) {
        console.error('Error fetching visitor centers 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. It mentions retrieving information and operating hours, but lacks details on permissions, rate limits, error handling, or response format. For a read operation with no annotation coverage, this is insufficient.

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 without unnecessary details. It is appropriately sized for a simple retrieval tool, with zero wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (4 parameters, no output schema, no annotations), the description is minimally adequate. It states what the tool does but lacks behavioral context and usage guidance. Without an output schema, it should ideally hint at the return structure, but this is not critical for a basic read operation.

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 the schema fully documents all four parameters. The description does not add any meaning beyond what the schema provides, such as explaining relationships between parameters or usage examples. Baseline 3 is appropriate when the schema handles parameter documentation.

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: 'Get information about visitor centers and their operating hours.' It specifies the verb ('Get') and resource ('visitor centers'), but does not differentiate from sibling tools like 'getParkDetails' or 'getCampgrounds' that might also provide visitor center information.

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?

No guidance is provided on when to use this tool versus alternatives. The description does not mention sibling tools or contexts where other tools might be more appropriate, such as using 'getParkDetails' for broader park information or 'findParks' for locating parks themselves.

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