Skip to main content
Glama
PeterShin23

SeatGeek MCP Server

find_events

Search for events by performer, location, date, or venue using structured queries. Returns detailed event data including venue information for ticketed entertainment.

Instructions

Search for events by performer, location, date, or venue. This tool is optimized for finding specific events based on user queries. If the query involves a performer, it first looks up the performer, then finds events for that performer. Otherwise, it searches events directly. Returns structured event data with venue information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
end_utcNoEnd date filter in ISO8601 UTC format (YYYY-MM-DD). Use with start_utc to define date ranges.
formatNoOutput format. Use "structured" for readable format (default) or "json" for raw API response. Only use "json" if explicitly requested.structured
pageNoPage number for pagination. Default is 1.
per_pageNoNumber of results to return per page (1-50). Default is 10.
qNoFree-text search term. Use only when no other specific filters match the user request. Keep this text to pronouns if present in the user's query unless there are no pronouns in the query. Never duplicate information already captured in other parameters.
start_utcNoStart date filter in ISO8601 UTC format (YYYY-MM-DD). Use for date ranges like "next month" or "this weekend".
venue_cityNoCity name where the venue is located. Use full city name, e.g., "New York" or "Los Angeles".
venue_countryNoCountry code where the venue is located, e.g., "US" for United States or "CA" for Canada.
venue_stateNoState abbreviation where the venue is located, e.g., "CA" for California or "NY" for New York.

Implementation Reference

  • The primary implementation of the find_events tool, including name, description, input schema reference, and the async handler function that parses input, performs performer lookups if needed, fetches events from API, deduplicates, condenses data, and returns formatted results or error details.
    export const findEventsTool = {
      name: 'find_events',
      description: 'Search for events by performer, location, date, or venue. This tool is optimized for finding specific events based on user queries. If the query involves a performer, it first looks up the performer, then finds events for that performer. Otherwise, it searches events directly. Returns structured event data with venue information.',
      inputSchema: inputSchema,
      handler: async (args: any, extra: any) => {
        const params = EventsQuerySchema.parse(args);
        
        try {
          let data: any;
          
          // If we have a query parameter, first check if it's a performer
          if (params.q) {
            try {
              // First try to find performers with the query
              const performers = await searchPerformers(params.q, params.per_page, 1);
              
              // If we found performers, aggregate unique performer slugs and make Promise.all query
              if (performers.length > 0) {
                // Get unique performer slugs
                const uniqueSlugs = [...new Set(performers.map((p: any) => p.slug).filter(Boolean))] as string[];
                
                if (uniqueSlugs.length > 0) {
                  // Create promises for each unique performer slug
                  const promises = uniqueSlugs.map(slug => {
                    const query = buildQuery(params, slug);
                    return fetchJson(EVENTS_ENDPOINT, query);
                  });
                  
                  // Execute all promises
                  const results = await Promise.all(promises);
                  
                  // Merge events from all results
                  data = { events: [] };
                  for (const result of results) {
                    if (result.events && Array.isArray(result.events)) {
                      data.events = data.events.concat(result.events);
                    }
                  }
                  
                  // Remove duplicates based on event id
                  const eventIds = new Set();
                  data.events = data.events.filter((event: any) => {
                    if (eventIds.has(event.id)) {
                      return false;
                    }
                    eventIds.add(event.id);
                    return true;
                  });
                } else {
                  // If no valid slugs found, search events directly with the q parameter
                  const query = buildQuery(params);
                  data = await fetchJson(EVENTS_ENDPOINT, query);
                }
              } else {
                // If no performer found, search events directly with the q parameter
                const query = buildQuery(params);
                data = await fetchJson(EVENTS_ENDPOINT, query);
              }
            } catch (error) {
              // If performer lookup fails, fall back to direct event search
              console.warn('Failed to lookup performer, falling back to direct event search:', error);
              const query = buildQuery(params);
              data = await fetchJson(EVENTS_ENDPOINT, query);
            }
          } else {
            // If no q parameter, search events directly
            const query = buildQuery(params);
            data = await fetchJson(EVENTS_ENDPOINT, query);
          }
          
          if (params.format === 'json') {
            return {
              content: [
                {
                  type: 'text' as const,
                  text: JSON.stringify(data, null, 2)
                }
              ]
            };
          }
          
          const eventsRaw = data.events || [];
          const results: CondensedEvent[] = [];
          
          for (const item of eventsRaw) {
            try {
              // Condense the event data
              const condensedEvent = condenseEventData(item);
              results.push(condensedEvent);
            } catch (error) {
              // Skip invalid events
              console.warn('Skipping invalid event:', error);
            }
          }
          
          return {
            content: [
              {
                type: 'text' as const,
                text: JSON.stringify(results, null, 2)
              }
            ]
          };
        } catch (error) {
          console.error('Error in find_events 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(),
            endpoint: EVENTS_ENDPOINT,
            args: args
          };
          
          return {
            content: [
              {
                type: 'text' as const,
                text: JSON.stringify({
                  error: 'Failed to fetch events',
                  details: errorDetails,
                  suggestion: 'Please check your parameters and try again. Common issues include invalid search terms or venue codes.'
                }, null, 2)
              }
            ]
          };
        }
      },
    };
  • Zod-based input schema defining parameters for the find_events tool, including validation, defaults, and detailed descriptions for each field.
    const inputSchema = {
      q: z.string().optional().describe('Free-text search term. Use only when no other specific filters match the user request. Keep this text to pronouns if present in the user\'s query unless there are no pronouns in the query. Never duplicate information already captured in other parameters.'),
      venue_city: z.string().optional().describe('City name where the venue is located. Use full city name, e.g., "New York" or "Los Angeles".'),
      venue_state: z.string().optional().describe('State abbreviation where the venue is located, e.g., "CA" for California or "NY" for New York.'),
      venue_country: z.string().optional().describe('Country code where the venue is located, e.g., "US" for United States or "CA" for Canada.'),
      start_utc: z.string().optional().describe('Start date filter in ISO8601 UTC format (YYYY-MM-DD). Use for date ranges like "next month" or "this weekend".'),
      end_utc: z.string().optional().describe('End date filter in ISO8601 UTC format (YYYY-MM-DD). Use with start_utc to define date ranges.'),
      per_page: z.number().min(1).max(50).default(10).describe('Number of results to return per page (1-50). Default is 10.'),
      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:23-23 (registration)
    Registers the find_events tool with the MCP server by calling mcpServer.tool with the tool's name, description, inputSchema, and handler.
    mcpServer.tool(findEventsTool.name, findEventsTool.description, findEventsTool.inputSchema, findEventsTool.handler);
  • Helper function to construct query parameters for the events API search, handling performer-specific queries, venue filters, date ranges, pagination, and filtering out empty values.
    function buildQuery(params: EventsQuery, performerSlug?: string): Record<string, any> {
      const query: Record<string, any> = {
        per_page: Math.min(params.per_page, 50),
        page: params.page,
      };
    
      // If we have a performer slug, use it instead of the general q parameter
      // and don't include venue information as requested
      if (performerSlug) {
        query["performers.slug"] = performerSlug;
      } else {
        // Use general q parameter and include venue information
        query.q = params.q;
        
        // Handle venue location - API expects flat format
        if (params.venue_city) {
          query["venue.city"] = params.venue_city;
        }
        if (params.venue_state) {
          query["venue.state"] = params.venue_state;
        }
        if (params.venue_country) {
          query["venue.country"] = params.venue_country;
        }
      }
    
      if (params.start_utc) {
        query["datetime_utc.gte"] = params.start_utc;
      }
    
      if (params.end_utc) {
        query["datetime_utc.lte"] = params.end_utc;
      }
    
      // Drop null/undefined values to avoid noisy query strings
      const filteredQuery: Record<string, any> = {};
      for (const [key, value] of Object.entries(query)) {
        if (value !== null && value !== undefined && value !== '') {
          filteredQuery[key] = value;
        }
      }
    
      return filteredQuery;
    }
  • Internal Zod schema used for parsing and validating the tool input arguments within the handler.
    const EventsQuerySchema = z.object({
      q: z.string().nullable().optional(),
      venue_city: z.string().nullable().optional(),
      venue_state: z.string().nullable().optional(),
      venue_country: z.string().nullable().optional(),
      start_utc: z.string().nullable().optional(),
      end_utc: z.string().nullable().optional(),
      per_page: z.number().min(1).max(50).default(10),
      page: z.number().min(1).default(1),
      format: z.enum(['structured', 'json']).default('structured'),
    });
    
    type EventsQuery = z.infer<typeof EventsQuerySchema>;
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the search logic (performer-first approach) and return format (structured event data with venue info), which is valuable. However, it doesn't mention potential limitations like rate limits, authentication needs, error conditions, or pagination behavior beyond what's in the schema, leaving gaps for a tool with 9 parameters.

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 efficiently structured in three sentences: first states the search purpose and criteria, second explains the optimization logic, third specifies the return format. Every sentence adds essential information without redundancy, making it appropriately sized and front-loaded.

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 complexity (9 parameters, no annotations, no output schema), the description is adequate but incomplete. It covers the core purpose and search logic well, but lacks details on error handling, performance expectations, or example use cases that would help an agent fully understand when and how to invoke it correctly.

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 already documents all 9 parameters thoroughly. The description adds minimal value beyond the schema by mentioning search criteria (performer, location, date, venue) but doesn't provide additional syntax, format details, or usage nuances for parameters. Baseline 3 is appropriate when the schema does heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool searches for events using specific criteria (performer, location, date, venue) and returns structured event data with venue information. It distinguishes itself from siblings like find_event_recommendations (which suggests events) and retrieve_event_venue_information (which focuses on venue details), establishing a specific search function.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context on when to use this tool: for searching events based on user queries with specific filters. It explains the optimization logic (performer-first search). However, it doesn't explicitly state when NOT to use it or name alternatives like the sibling tools, missing full differentiation.

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

Related 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/PeterShin23/seatgeek-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server