Skip to main content
Glama

get_upcoming_events

Find upcoming music events in a specific city within a date range. Filter results by keyword to discover concerts and shows.

Instructions

Get upcoming music events for a city.

Args: city: City in which to search for events. start_dttm_str: Start date/time in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ). Example: 2025-02-08T00:00:00Z end_dttm_str: Start date/time in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ). Example: 2025-02-10T00:00:00Z keyword: Any optional keywords to help filter search results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cityYes
start_dttm_strYes
end_dttm_strYes
keywordNo

Implementation Reference

  • The main handler function for the 'get_upcoming_events' tool, registered via @mcp.tool() decorator. It fetches events using EventsApiClient and formats them with format_events.
    @mcp.tool()
    async def get_upcoming_events(city: str, start_dttm_str: str, end_dttm_str: str, keyword: str | None = None) -> str:
        """
        Get upcoming music events for a city.
        
        Args:
            city: City in which to search for events.
            start_dttm_str: Start date/time in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ). Example: 2025-02-08T00:00:00Z
            end_dttm_str: Start date/time in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ). Example: 2025-02-10T00:00:00Z
            keyword: Any optional keywords to help filter search results.
        """
    
        data = await EventsApiClient().fetch_events(city=city, start_dttm_str=start_dttm_str, end_dttm_str=end_dttm_str, keyword=keyword)
    
        return format_events(data)
  • Helper method in EventsApiClient that performs the actual API call to Ticketmaster to fetch upcoming events based on parameters.
    async def fetch_events(
        self,
        city: str,
        start_dttm_str: str,
        end_dttm_str: str,
        classification_name: str = "Music",
        keyword: str | None = None,
    ) -> dict | None:
        async with httpx.AsyncClient() as client:
            try:
                params = {
                    "apikey": self.api_key,
                    "city": city,
                    "startDateTime": start_dttm_str,
                    "endDateTime": end_dttm_str,
                    "classificationName": classification_name,
                    "size": 100,
                }
                if keyword:
                    params["keyword"] = keyword
                response = await client.get(
                    f"{self.base_url}/events.json",
                    params=params,
                    timeout=30.0,
                )
                response.raise_for_status()
                return response.json()
            except Exception:
                return None
  • Helper function that formats the raw events data from the API into a human-readable string with details for each event.
    def format_events(response_dict: dict) -> str:
        if not response_dict:
            return "No events found!"
    
        return "\n\n".join(
            [
                f"""
    Name: {event.get("name")}
    Link: {event.get("url")}
    Event Datetime: {event.get("dates")["start"]["dateTime"]}
    Genres: {", ".join(set(c["genre"]["name"] for c in event.get("classifications")))}
    Info: {event.get("info")}
    Venue: {event.get("_embedded")["venues"][0]["name"]}
    """
                for event in response_dict["_embedded"]["events"]
            ]
        )
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It implies a read-only operation ('Get') but lacks details on permissions, rate limits, pagination, error handling, or response format. This leaves significant gaps for a tool with 4 parameters and no output schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with the core purpose in the first sentence. The parameter documentation is structured with bullet points, though the repetition of 'Start date/time' for 'end_dttm_str' is slightly misleading. Overall, it's efficient with minimal waste.

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 moderate complexity (4 parameters, no output schema, no annotations), the description is partially complete. It excels in parameter semantics but lacks behavioral context, usage guidelines, and output details. This results in an adequate but gap-filled description for an agent to use effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate fully. It explicitly documents all 4 parameters with clear semantics: 'city' for location, 'start_dttm_str' and 'end_dttm_str' for date/time range in ISO 8601 format with examples, and 'keyword' as optional for filtering. This adds substantial value beyond the bare schema.

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 tool's purpose: 'Get upcoming music events for a city.' It specifies the verb ('Get'), resource ('upcoming music events'), and scope ('for a city'). However, since there are no sibling tools, it cannot differentiate from alternatives, preventing a score of 5.

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?

The description provides no guidance on when to use this tool versus alternatives, prerequisites, or exclusions. It only lists parameters without context about appropriate scenarios or constraints, offering minimal usage direction.

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/mmmaaatttttt/mcp-live-events'

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