# generated by fastapi-codegen:
# filename: openapi.yaml
# timestamp: 2025-06-29T10:30:35+00:00
import argparse
import json
import os
from typing import *
from typing import Optional
from autogen.mcp.mcp_proxy import MCPProxy
from autogen.mcp.mcp_proxy.security import BaseSecurity
from fastapi import Query
from pydantic import constr
from models import (
Attraction,
Classification,
ClassificationId,
ClassificationName,
DiscoveryV2AttractionsGetResponse,
DiscoveryV2ClassificationsGetResponse,
DiscoveryV2EventsGetResponse,
DiscoveryV2VenuesGetResponse,
Event,
EventImages,
Genre,
IncludeFuzzy,
IncludeLicensedContent,
IncludeSpellcheck,
IncludeTBA,
IncludeTBD,
IncludeTest,
Level,
Segment,
Source1,
Unit,
Venue,
)
app = MCPProxy(
contact={'url': 'http://developer.ticketmaster.com/support/contact-us/'},
description='The Ticketmaster Discovery API allows you to search for events, attractions, or venues.',
title='Discovery API',
version='v2',
servers=[{'url': '//www.ticketmaster.com/discovery/v2'}],
)
@app.get(
'/discovery/v2/attractions',
description=""" Find attractions (artists, sports, packages, plays and so on) and filter your search by name, and much more. """,
tags=['attraction_information', 'classification_handling'],
)
def find(
sort: Optional[constr(pattern=r'^(name|relevance),(asc|desc)$')] = 'relevance,desc',
classification_name: Optional[ClassificationName] = Query(
'', alias='classificationName'
),
classification_id: Optional[ClassificationId] = Query('', alias='classificationId'),
keyword: Optional[str] = '',
id: Optional[str] = '',
source: Optional[Source1] = '',
include_test: Optional[IncludeTest] = Query('no', alias='includeTest'),
page: Optional[str] = '0',
size: Optional[str] = '20',
locale: Optional[str] = 'en',
include_licensed_content: Optional[IncludeLicensedContent] = Query(
'no', alias='includeLicensedContent'
),
include_spellcheck: Optional[IncludeSpellcheck] = Query(
'no', alias='includeSpellcheck'
),
):
"""
Attraction Search
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/discovery/v2/attractions/{id}',
description=""" Get details for a specific attraction using the unique identifier for the attraction. """,
tags=['attraction_information'],
)
def get(
id: str,
locale: Optional[str] = 'en',
include_licensed_content: Optional[IncludeLicensedContent] = Query(
'no', alias='includeLicensedContent'
),
):
"""
Get Attraction Details
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/discovery/v2/classifications',
description=""" Find classifications and filter your search by name, and much more. Classifications help define the nature of attractions and events. """,
tags=['classification_handling'],
)
def get_discovery_v2_classifications(
sort: Optional[constr(pattern=r'^name,asc|name,desc$')] = 'name,asc',
keyword: Optional[str] = '',
id: Optional[str] = '',
source: Optional[Source1] = '',
include_test: Optional[IncludeTest] = Query('no', alias='includeTest'),
page: Optional[str] = '0',
size: Optional[str] = '20',
locale: Optional[str] = 'en',
include_licensed_content: Optional[IncludeLicensedContent] = Query(
'no', alias='includeLicensedContent'
),
include_spellcheck: Optional[IncludeSpellcheck] = Query(
'no', alias='includeSpellcheck'
),
):
"""
Classification Search
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/discovery/v2/classifications/genres/{id}',
description=""" Get details for a specific genre using its unique identifier. """,
tags=['genre_handling'],
)
def get_genre(
id: str,
locale: Optional[str] = 'en',
include_licensed_content: Optional[IncludeLicensedContent] = Query(
'no', alias='includeLicensedContent'
),
):
"""
Get Genre Details
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/discovery/v2/classifications/segments/{id}',
description=""" Get details for a specific segment using its unique identifier. """,
tags=['segment_handling'],
)
def get_segment(
id: str,
locale: Optional[str] = 'en',
include_licensed_content: Optional[IncludeLicensedContent] = Query(
'no', alias='includeLicensedContent'
),
):
"""
Get Segment Details
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/discovery/v2/classifications/subgenres/{id}',
description=""" Get details for a specific sub-genre using its unique identifier. """,
tags=['subgenre_handling', 'genre_handling'],
)
def get_subgenre(
id: str,
locale: Optional[str] = 'en',
include_licensed_content: Optional[IncludeLicensedContent] = Query(
'no', alias='includeLicensedContent'
),
):
"""
Get Sub-Genre Details
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/discovery/v2/classifications/{id}',
description=""" Get details for a specific segment, genre, or sub-genre using its unique identifier. """,
tags=['classification_handling'],
)
def get_discovery_v2_classifications__id(
id: str,
locale: Optional[str] = 'en',
include_licensed_content: Optional[IncludeLicensedContent] = Query(
'no', alias='includeLicensedContent'
),
):
"""
Get Classification Details
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/discovery/v2/events',
description=""" Find events and filter your search by location, date, availability, and much more. """,
tags=['event_management', 'attraction_information'],
)
def get_discovery_v2_events(
sort: Optional[
constr(
pattern=r'^((name|date|relevance|name,date|date,name),(asc|desc))|(distance,asc)|(onSaleStartDate,asc)|(id,asc)$'
)
] = 'relevance,desc',
start_date_time: Optional[str] = Query('', alias='startDateTime'),
end_date_time: Optional[str] = Query('', alias='endDateTime'),
onsale_start_date_time: Optional[str] = Query('', alias='onsaleStartDateTime'),
onsale_on_start_date: Optional[str] = Query('', alias='onsaleOnStartDate'),
onsale_on_after_start_date: Optional[str] = Query(
'', alias='onsaleOnAfterStartDate'
),
onsale_end_date_time: Optional[str] = Query('', alias='onsaleEndDateTime'),
city: Optional[str] = '',
country_code: Optional[str] = Query('', alias='countryCode'),
state_code: Optional[str] = Query('', alias='stateCode'),
postal_code: Optional[str] = Query('', alias='postalCode'),
venue_id: Optional[str] = Query('', alias='venueId'),
attraction_id: Optional[str] = Query('', alias='attractionId'),
segment_id: Optional[str] = Query('', alias='segmentId'),
segment_name: Optional[str] = Query('', alias='segmentName'),
classification_name: Optional[ClassificationName] = Query(
'', alias='classificationName'
),
classification_id: Optional[ClassificationId] = Query('', alias='classificationId'),
market_id: Optional[constr(pattern=r'^\s*$|^(\d+(,\d+)*)?$')] = Query(
'', alias='marketId'
),
promoter_id: Optional[constr(pattern=r'^\s*$|^(\d+(,\d+)*)?$')] = Query(
'', alias='promoterId'
),
dma_id: Optional[constr(pattern=r'^\s*$|^(\d+(,\d+)*)?$')] = Query(
'', alias='dmaId'
),
include_t_b_a: Optional[IncludeTBA] = Query(
'no if date parameter sent, yes otherwise', alias='includeTBA'
),
include_t_b_d: Optional[IncludeTBD] = Query(
'no if date parameter sent, yes otherwise', alias='includeTBD'
),
client_visibility: Optional[str] = Query('', alias='clientVisibility'),
latlong: Optional[
constr(
pattern=r'^\s*$|^-?(90(\.0+)?|[0-8]?[0-9](\.\d+)?),-?(180(\.0+)?|(1[0-7][0-9]|\d{1,2})(\.\d+)?)$'
)
] = '',
radius: Optional[constr(pattern=r'^\s*$|^0*1?\d{1,4}$')] = '50',
unit: Optional[Unit] = 'miles',
geo_point: Optional[
constr(
pattern=r'^\s*$|^-?(90(\.0+)?|[0-8]?[0-9](\.\d+)?),-?(180(\.0+)?|(1[0-7][0-9]|\d{1,2})(\.\d+)?)$|^[a-zA-Z0-9]{1,9}$'
)
] = Query('', alias='geoPoint'),
keyword: Optional[str] = '',
id: Optional[str] = '',
source: Optional[Source1] = '',
include_test: Optional[IncludeTest] = Query('no', alias='includeTest'),
page: Optional[str] = '0',
size: Optional[str] = '20',
locale: Optional[str] = 'en',
include_licensed_content: Optional[IncludeLicensedContent] = Query(
'no', alias='includeLicensedContent'
),
include_spellcheck: Optional[IncludeSpellcheck] = Query(
'no', alias='includeSpellcheck'
),
):
"""
Event Search
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/discovery/v2/events/{id}',
description=""" Get details for a specific event using the unique identifier for the event. This includes the venue and location, the attraction(s), and the Ticketmaster Website URL for purchasing tickets for the event. """,
tags=['event_management', 'attraction_information'],
)
def get_discovery_v2_events__id(
id: str,
locale: Optional[str] = 'en',
include_licensed_content: Optional[IncludeLicensedContent] = Query(
'no', alias='includeLicensedContent'
),
):
"""
Get Event Details
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/discovery/v2/events/{id}/images',
description=""" Get images for a specific event using the unique identifier for the event. """,
tags=['event_management', 'attraction_information'],
)
def get_images(
id: str,
locale: Optional[str] = 'en',
include_licensed_content: Optional[IncludeLicensedContent] = Query(
'no', alias='includeLicensedContent'
),
):
"""
Get Event Images
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/discovery/v2/suggest',
description=""" Find search suggestions and filter your suggestions by location, source, etc. """,
tags=['attraction_information', 'venue_information'],
)
def get_discovery_v2_suggest(
keyword: Optional[str] = '',
source: Optional[Source1] = '',
latlong: Optional[
constr(
pattern=r'^\s*$|^-?(90(\.0+)?|[0-8]?[0-9](\.\d+)?),-?(180(\.0+)?|(1[0-7][0-9]|\d{1,2})(\.\d+)?)$'
)
] = '',
radius: Optional[constr(pattern=r'^\s*$|^0*1?\d{1,4}$')] = '100',
unit: Optional[Unit] = 'miles',
size: Optional[str] = '5',
include_fuzzy: Optional[IncludeFuzzy] = Query('no', alias='includeFuzzy'),
client_visibility: Optional[str] = Query('', alias='clientVisibility'),
country_code: Optional[str] = Query('', alias='countryCode'),
include_t_b_a: Optional[IncludeTBA] = Query(
'no if date parameter sent, yes otherwise', alias='includeTBA'
),
include_t_b_d: Optional[IncludeTBD] = Query(
'no if date parameter sent, yes otherwise', alias='includeTBD'
),
segment_id: Optional[str] = Query('', alias='segmentId'),
geo_point: Optional[
constr(
pattern=r'^\s*$|^-?(90(\.0+)?|[0-8]?[0-9](\.\d+)?),-?(180(\.0+)?|(1[0-7][0-9]|\d{1,2})(\.\d+)?)$|^[a-zA-Z0-9]{1,9}$'
)
] = Query('', alias='geoPoint'),
locale: Optional[str] = 'en',
include_licensed_content: Optional[IncludeLicensedContent] = Query(
'no', alias='includeLicensedContent'
),
include_spellcheck: Optional[IncludeSpellcheck] = Query(
'no', alias='includeSpellcheck'
),
):
"""
Find Suggest
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/discovery/v2/venues',
description=""" Find venues and filter your search by name, and much more. """,
tags=['venue_information', 'attraction_information'],
)
def get_discovery_v2_venues(
sort: Optional[
constr(pattern=r'^(name|relevance|distance),(asc|desc)$')
] = 'relevance,desc',
state_code: Optional[str] = Query('', alias='stateCode'),
country_code: Optional[str] = Query('', alias='countryCode'),
latlong: Optional[
constr(
pattern=r'^\s*$|^-?(90(\.0+)?|[0-8]?[0-9](\.\d+)?),-?(180(\.0+)?|(1[0-7][0-9]|\d{1,2})(\.\d+)?)$'
)
] = '',
radius: Optional[constr(pattern=r'^\s*$|^0*1?\d{1,4}$')] = '50',
unit: Optional[Unit] = 'miles',
geo_point: Optional[
constr(
pattern=r'^\s*$|^-?(90(\.0+)?|[0-8]?[0-9](\.\d+)?),-?(180(\.0+)?|(1[0-7][0-9]|\d{1,2})(\.\d+)?)$|^[a-zA-Z0-9]{1,9}$'
)
] = Query('', alias='geoPoint'),
keyword: Optional[str] = '',
id: Optional[str] = '',
source: Optional[Source1] = '',
include_test: Optional[IncludeTest] = Query('no', alias='includeTest'),
page: Optional[str] = '0',
size: Optional[str] = '20',
locale: Optional[str] = 'en',
include_licensed_content: Optional[IncludeLicensedContent] = Query(
'no', alias='includeLicensedContent'
),
include_spellcheck: Optional[IncludeSpellcheck] = Query(
'no', alias='includeSpellcheck'
),
):
"""
Venue Search
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/discovery/v2/venues/{id}',
description=""" Get details for a specific venue using the unique identifier for the venue. """,
tags=['venue_information', 'attraction_information'],
)
def get_discovery_v2_venues__id(
id: str,
locale: Optional[str] = 'en',
include_licensed_content: Optional[IncludeLicensedContent] = Query(
'no', alias='includeLicensedContent'
),
):
"""
Get Venue Details
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="MCP Server")
parser.add_argument(
"transport",
choices=["stdio", "sse", "streamable-http"],
help="Transport mode (stdio, sse or streamable-http)",
)
args = parser.parse_args()
if "CONFIG_PATH" in os.environ:
config_path = os.environ["CONFIG_PATH"]
app.load_configuration(config_path)
if "CONFIG" in os.environ:
config = os.environ["CONFIG"]
app.load_configuration_from_string(config)
if "SECURITY" in os.environ:
security_params = BaseSecurity.parse_security_parameters_from_env(
os.environ,
)
app.set_security_params(security_params)
mcp_settings = json.loads(os.environ.get("MCP_SETTINGS", "{}"))
app.get_mcp(**mcp_settings).run(transport=args.transport)