retrieve_event_venue_information
Retrieve detailed venue seating layouts, including sections and rows, for a specific event. Use this tool to explore seating options and inform ticket purchasing decisions with structured or JSON output.
Instructions
Get detailed seating information including sections and rows for a specific event. This tool first searches for the event using the provided query, then retrieves detailed venue layout information. Useful for understanding venue seating options and making ticket purchasing decisions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| event_id | Yes | The unique identifier for the event to retrieve venue information for. This ID is obtained from the event. | |
| format | No | Output format. Use "structured" for readable format (default) or "json" for raw API response. Only use "json" if explicitly requested. | structured |
| page | No | Page number for pagination. Default is 1. |
Implementation Reference
- The handler function executes the core logic: parses input, fetches venue section data from API, handles formatting (structured/json), parses with Zod schema, and returns formatted text content or error details.handler: async (args: any, extra: any) => { try { const params = EventVenueInformationQuerySchema.parse(args); // Call the section info endpoint with the event ID const data = await fetchJson(`${SECTION_INFO_ENDPOINT}/${params.event_id}`, {}); if (params.format === 'json') { return { content: [ { type: 'text' as const, text: JSON.stringify(data, null, 2) } ] }; } try { const sectionInfo = SectionInfoSchema.parse(data); return { content: [ { type: 'text' as const, text: JSON.stringify(sectionInfo, null, 2) } ] }; } catch (error) { // Return raw data if parsing fails console.warn('Failed to parse section info:', error); return { content: [ { type: 'text' as const, text: JSON.stringify(data, null, 2) } ] }; } } catch (error) { console.error('Error in retrieve_event_venue_information handler:', error); // Provide more detailed error information const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred'; const errorDetails = { error: 'API_REQUEST_FAILED', message: errorMessage, timestamp: new Date().toISOString(), args: args }; return { content: [ { type: 'text' as const, text: JSON.stringify({ error: 'Failed to fetch event venue information', details: errorDetails, suggestion: 'Please check your parameters and try again. Common issues include invalid search terms or the event not having section information available.' }, null, 2) } ] }; } },
- Zod-based input schema defining parameters: event_id (required), page (optional), format (optional). Used for validation in the handler and registration.const inputSchema = { event_id: z.number().describe('The unique identifier for the event to retrieve venue information for. This ID is obtained from the event.'), page: z.number().min(1).default(1).describe('Page number for pagination. Default is 1.'), format: z.enum(['structured', 'json']).default('structured').describe('Output format. Use "structured" for readable format (default) or "json" for raw API response. Only use "json" if explicitly requested.'), };
- src/server.ts:26-26 (registration)Registers the retrieve_event_venue_information tool with the MCP server using its name, description, inputSchema, and handler.mcpServer.tool(retrieveEventVenueInformationTool.name, retrieveEventVenueInformationTool.description, retrieveEventVenueInformationTool.inputSchema, retrieveEventVenueInformationTool.handler);
- Internal Zod schema used to parse arguments in the handler (identical to inputSchema).const EventVenueInformationQuerySchema = z.object({ event_id: z.number().describe('The unique identifier for the event to retrieve venue information for. This ID is obtained from the event.'), page: z.number().min(1).default(1).describe('Page number for pagination. Default is 1.'), format: z.enum(['structured', 'json']).default('structured').describe('Output format. Use "structured" for readable format (default) or "json" for raw API response. Only use "json" if explicitly requested.'), });
- Zod schema for parsing the API response data into structured sections format.const SectionInfoSchema = z.object({ sections: z.record(z.array(z.string())).nullable(), });