list_parks
Retrieve all Disney parks with IDs, names, and locations to use for filtering attractions or dining at Walt Disney World and Disneyland Resort.
Instructions
List all Disney parks with their IDs, names, and locations. Returns Walt Disney World (wdw) and Disneyland Resort (dlr) with their theme parks. Use park IDs from this response when filtering attractions or dining.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/destinations.ts:26-49 (handler)Main execution logic for list_parks tool: checks cache, fetches destinations/parks from Disney client if needed, caches for 7 days, formats result.export const handler: ToolHandler = async () => { return withTimeout( "list_parks", async () => { const cacheKey = "destinations"; // Check cache (7-day TTL for destinations) const cached = await cacheGet<DisneyDestination[]>(cacheKey); if (cached) { return formatResult(cached.data, cached.cachedAt); } // Fetch destinations const client = getDisneyFinderClient(); const destinations = await client.getDestinations(); // Cache for 7 days await cacheSet(cacheKey, destinations, { ttlHours: 24 * 7 }); return formatResult(destinations, new Date().toISOString()); }, TIMEOUTS.DEFAULT ); };
- src/tools/destinations.ts:13-24 (schema)Tool schema definition including name, description, and empty input schema (no parameters required).export const definition: ToolDefinition = { name: "list_parks", description: "List all Disney parks with their IDs, names, and locations. " + "Returns Walt Disney World (wdw) and Disneyland Resort (dlr) with their theme parks. " + "Use park IDs from this response when filtering attractions or dining.", inputSchema: { type: "object" as const, properties: {}, required: [], }, };
- src/tools/index.ts:20-28 (registration)Registration of all tools in array, including list_parks via destinations module; used by registerTools to populate tool map by name.const tools: ToolEntry[] = [ { definition: destinations.definition, handler: destinations.handler }, { definition: attractions.definition, handler: attractions.handler }, { definition: dining.definition, handler: dining.handler }, { definition: search.definition, handler: search.handler }, { definition: discover.definition, handler: discover.handler }, { definition: status.definition, handler: status.handler }, { definition: sync.definition, handler: sync.handler }, ];
- src/tools/destinations.ts:51-83 (helper)Helper function to format destinations and parks data into JSON response with metadata.function formatResult( destinations: DisneyDestination[], cachedAt: string ): { content: Array<{ type: "text"; text: string }> } { return { content: [ { type: "text" as const, text: JSON.stringify( { destinations: destinations.map((d) => ({ id: d.id, name: d.name, location: d.location, timezone: d.timezone, parks: d.parks.map((p) => ({ id: p.id, name: p.name, slug: p.slug, })), })), _meta: { cachedAt, source: "disney", }, }, null, 2 ), }, ], }; }