Skip to main content
Glama
delorenj

MCP Server for Ticketmaster Events

search_ticketmaster

Search for Ticketmaster events, venues, or attractions by keyword, date, location, or category to find specific event details and purchase options.

Instructions

Search for events, venues, or attractions on Ticketmaster

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesType of search to perform
keywordNoSearch keyword or term
startDateNoStart date in YYYY-MM-DD format
endDateNoEnd date in YYYY-MM-DD format
cityNoCity name
stateCodeNoState code (e.g., NY, CA)
countryCodeNoCountry code (e.g., US, CA)
venueIdNoSpecific venue ID to search
attractionIdNoSpecific attraction ID to search
classificationNameNoEvent classification/category (e.g., "Sports", "Music")
formatNoOutput format (defaults to json)json

Implementation Reference

  • The CallToolRequestSchema handler that executes the search_ticketmaster tool logic. It extracts parameters, calls the appropriate client method based on search type, and formats the response.
    this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
        if (request.params.name !== 'search_ticketmaster') {
            throw new McpError(
                ErrorCode.MethodNotFound,
                `Unknown tool: ${request.params.name}`
            );
        }
    
        const {
            type,
            format = 'json',
            keyword,
            startDate,
            endDate,
            ...otherParams
        } = request.params.arguments as {
            type: SearchType;
            format?: 'json' | 'text';
            keyword?: string;
            startDate?: string;
            endDate?: string;
            city?: string;
            stateCode?: string;
            countryCode?: string;
            venueId?: string;
            attractionId?: string;
            classificationName?: string;
        };
    
        try {
            const query = {
                keyword,
                startDateTime: startDate ? new Date(startDate) : undefined,
                endDateTime: endDate ? new Date(endDate) : undefined,
                ...otherParams
            };
    
            let results;
            switch (type) {
                case 'event':
                    results = await this.client.searchEvents(query);
                    break;
                case 'venue':
                    results = await this.client.searchVenues(query);
                    break;
                case 'attraction':
                    results = await this.client.searchAttractions(query);
                    break;
                default:
                    throw new McpError(
                        ErrorCode.InvalidParams,
                        `Invalid search type: ${type}`
                    );
            }
    
            const content = format === 'json' 
                ? JSON.stringify(results, null, 2)
                : formatResults(type, results, format !== 'text');
    
            return {
                content: [
                    {
                        type: 'text',
                        text: content,
                    },
                ],
            };
        } catch (error) {
            if (error instanceof Error) {
                return {
                    content: [
                        {
                            type: 'text',
                            text: `Error: ${error.message}`,
                        },
                    ],
                    isError: true,
                };
            }
            throw error;
        }
    });
  • Core implementation methods: search(), searchEvents(), searchVenues(), and searchAttractions() that handle API calls to Ticketmaster Discovery API with query parameters.
    async search<T extends TicketmasterEvent | TicketmasterVenue | TicketmasterAttraction>(
        type: SearchType,
        query: {
            keyword?: string;
            startDateTime?: Date;
            endDateTime?: Date;
            city?: string;
            stateCode?: string;
            countryCode?: string;
            venueId?: string;
            attractionId?: string;
            classificationName?: string;
            size?: number;
        } = {}
    ): Promise<T[]> {
        try {
            const endpoint = `${this.baseUrl}/${type}s`;
            const params: Record<string, string | number> = {
                apikey: this.apiKey,
                size: query.size || 20
            };
    
            if (query.keyword) {
                params.keyword = query.keyword;
            }
    
            if (query.startDateTime && query.endDateTime) {
                const dateRange = this.formatDateRange(query.startDateTime, query.endDateTime);
                params.startDateTime = dateRange.split(',')[0];
                params.endDateTime = dateRange.split(',')[1];
            }
    
            if (query.city) {
                params.city = query.city;
            }
    
            if (query.stateCode) {
                params.stateCode = query.stateCode;
            }
    
            if (query.countryCode) {
                params.countryCode = query.countryCode;
            }
    
            if (query.venueId) {
                params.venueId = query.venueId;
            }
    
            if (query.attractionId) {
                params.attractionId = query.attractionId;
            }
    
            if (query.classificationName) {
                params.classificationName = query.classificationName;
            }
    
            const response = await axios.get<TicketmasterResponse>(endpoint, { params });
    
            const items = response.data._embedded?.[`${type}s` as keyof typeof response.data._embedded] as T[] || [];
            return items;
    
        } catch (error) {
            if (axios.isAxiosError(error)) {
                const axiosError = error as AxiosError<TicketmasterError>;
                const apiError = axiosError.response?.data?.fault;
                
                throw new TicketmasterApiError(
                    apiError?.faultstring || 'Failed to fetch results',
                    apiError?.detail?.errorcode,
                    axiosError.response?.status
                );
            }
            
            throw error;
        }
    }
    
    /**
     * Search for events
     */
    async searchEvents(query: Parameters<typeof this.search>[1] = {}): Promise<TicketmasterEvent[]> {
        return this.search<TicketmasterEvent>('event', query);
    }
    
    /**
     * Search for venues
     */
    async searchVenues(query: Parameters<typeof this.search>[1] = {}): Promise<TicketmasterVenue[]> {
        return this.search<TicketmasterVenue>('venue', query);
    }
    
    /**
     * Search for attractions
     */
    async searchAttractions(query: Parameters<typeof this.search>[1] = {}): Promise<TicketmasterAttraction[]> {
        return this.search<TicketmasterAttraction>('attraction', query);
    }
  • src/index.ts:48-109 (registration)
    Tool registration in ListToolsRequestSchema handler defining the search_ticketmaster tool with its input schema including type, keyword, dates, location, and format options.
    private setupToolHandlers() {
        this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
            tools: [
                {
                    name: 'search_ticketmaster',
                    description: 'Search for events, venues, or attractions on Ticketmaster',
                    inputSchema: {
                        type: 'object',
                        properties: {
                            type: {
                                type: 'string',
                                enum: ['event', 'venue', 'attraction'],
                                description: 'Type of search to perform'
                            },
                            keyword: {
                                type: 'string',
                                description: 'Search keyword or term'
                            },
                            startDate: {
                                type: 'string',
                                description: 'Start date in YYYY-MM-DD format'
                            },
                            endDate: {
                                type: 'string',
                                description: 'End date in YYYY-MM-DD format'
                            },
                            city: {
                                type: 'string',
                                description: 'City name'
                            },
                            stateCode: {
                                type: 'string',
                                description: 'State code (e.g., NY, CA)'
                            },
                            countryCode: {
                                type: 'string',
                                description: 'Country code (e.g., US, CA)'
                            },
                            venueId: {
                                type: 'string',
                                description: 'Specific venue ID to search'
                            },
                            attractionId: {
                                type: 'string',
                                description: 'Specific attraction ID to search'
                            },
                            classificationName: {
                                type: 'string',
                                description: 'Event classification/category (e.g., "Sports", "Music")'
                            },
                            format: {
                                type: 'string',
                                enum: ['json', 'text'],
                                description: 'Output format (defaults to json)',
                                default: 'json'
                            }
                        },
                        required: ['type'],
                    },
                },
            ],
        }));
  • Type definitions for SearchType, TicketmasterEvent, TicketmasterVenue, TicketmasterAttraction, TicketmasterResponse, and TicketmasterApiError used throughout the tool.
    export type SearchType = 'event' | 'venue' | 'attraction';
    
    export interface TicketmasterEvent {
        id: string;
        name: string;
        type: string;
        url: string;
        locale: string;
        dates: {
            start: {
                localDate: string;
                localTime: string;
                dateTime: string;
            };
            timezone?: string;
            status: {
                code: string;
            };
        };
        priceRanges?: Array<{
            type: string;
            currency: string;
            min: number;
            max: number;
        }>;
        images: Array<{
            ratio: string;
            url: string;
            width: number;
            height: number;
        }>;
        _embedded?: {
            venues?: TicketmasterVenue[];
            attractions?: TicketmasterAttraction[];
        };
    }
    
    export interface TicketmasterVenue {
        id: string;
        name: string;
        type: string;
        url?: string;
        locale: string;
        postalCode?: string;
        timezone?: string;
        city: {
            name: string;
        };
        state: {
            name: string;
            stateCode: string;
        };
        country: {
            name: string;
            countryCode: string;
        };
        address: {
            line1: string;
        };
        location?: {
            longitude: string;
            latitude: string;
        };
    }
    
    export interface TicketmasterAttraction {
        id: string;
        name: string;
        type: string;
        url?: string;
        locale: string;
        images?: Array<{
            ratio: string;
            url: string;
            width: number;
            height: number;
        }>;
        classifications?: Array<{
            primary: boolean;
            segment: {
                id: string;
                name: string;
            };
            genre: {
                id: string;
                name: string;
            };
        }>;
    }
    
    export interface TicketmasterResponse {
        _embedded?: {
            events?: TicketmasterEvent[];
            venues?: TicketmasterVenue[];
            attractions?: TicketmasterAttraction[];
        };
        page: {
            size: number;
            totalElements: number;
            totalPages: number;
            number: number;
        };
    }
    
    export interface TicketmasterError {
        fault: {
            faultstring: string;
            detail: {
                errorcode: string;
            };
        };
    }
    
    export class TicketmasterApiError extends Error {
        constructor(
            message: string,
            public readonly code?: string,
            public readonly status?: number
        ) {
            super(message);
            this.name = 'TicketmasterApiError';
        }
    }
  • formatResults() helper function that formats search results as readable text when format parameter is set to 'text'.
    export function formatResults(
        type: 'event' | 'venue' | 'attraction',
        results: Array<TicketmasterEvent | TicketmasterVenue | TicketmasterAttraction>,
        structured = true
    ): string {
        if (results.length === 0) {
            return 'No results found.';
        }
    
        const formatters = {
            event: formatEvent,
            venue: formatVenue,
            attraction: formatAttraction,
        };
    
        const formatter = formatters[type];
        return results.map(item => formatter(item as any, structured)).join('\n\n');
    }
Behavior2/5

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

With no annotations, the description carries full burden but provides minimal behavioral insight. It mentions searching but doesn't disclose rate limits, authentication needs, pagination, error handling, or what happens with partial/no results. This is inadequate for a search tool with 11 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 a single, efficient sentence that front-loads the core purpose without unnecessary words. It earns its place by clearly stating the tool's function in minimal space.

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?

For a complex search tool with 11 parameters, no annotations, and no output schema, the description is insufficient. It lacks details on behavior, output format (beyond the 'format' parameter), error cases, and usage context, leaving significant gaps for an AI agent.

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 parameters. The description adds no additional meaning beyond implying search across multiple resource types, which aligns with the 'type' parameter. 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 resources ('events, venues, or attractions on Ticketmaster'), making the purpose immediately understandable. It doesn't need to distinguish from siblings since none exist, but it could be more specific about what 'search' entails (e.g., listing vs. filtering).

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 or any prerequisites. The description merely states what it does without context about appropriate scenarios, limitations, or integration with other tools.

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/delorenj/mcp-server-ticketmaster'

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