Skip to main content
Glama
richarda23

Edinburgh Festivals MCP Server

by richarda23

edinburgh_festival_venues

Search for Edinburgh festival venues by name, postcode, or festival to find locations and details for planning visits.

Instructions

Search Edinburgh festival venues

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
festivalNointernational
postcodeNo
nameNo
yearNo2025
number_of_resultsNo
pageNo

Implementation Reference

  • main.py:17-48 (handler)
    The primary handler function for the edinburgh_festival_venues MCP tool. It defines the input schema via parameters, includes documentation, prepares and filters query parameters, and delegates to the EdFestCli.venues() helper to perform the API search for Edinburgh festival venues.
    @mcp.tool(description="Search Edinburgh festival venues") def edinburgh_festival_venues( festival: str = "international", postcode: str = None, name: str = None, year: str = "2025", number_of_results=25, page=0, ) -> List[Dict]: """ Searches Edinburgh festival venues. :param festival: The type of festival to search for venues in. :param postcode: The postcode to filter venues by. :param name: The name of the venue to search for. :param year: The year of the festival. :return: A dictionary containing venue information. :param number_of_results: The maximum number of results to retrieve, up to 100 at a time. :param page: The page number for pagination, starting from 0. : """ params = { "festival": festival, "year": year, "postcode": postcode, "name": name, "size": number_of_results, "page": page, } filtered_params = {k: v for k, v in params.items() if v} results = cli.venues(filtered_params) return results
  • Supporting methods in EdFestCli class: events(), venues(), and _send_request(). The venues() method is called by the tool handler and uses _send_request() to sign and send HTTP GET requests to the Edinburgh Festival City API for fetching venue data.
    def events(self, params: Dict) -> List[Dict]: if params.get("festival") == "fringe" and self._fringe_mode != "real": params["festival"] = "demofringe" return self._send_request("events", params) def venues(self, params: Dict) -> List[Dict]: return self._send_request("venues", params) def _send_request(self, path: str, params: Dict) -> Dict: params["key"] = self._apikey query = urlencode(params) url_to_sign = f"/{path}?{query}" signature = hmac.new( self._apisecret.encode("utf-8"), url_to_sign.encode("utf-8"), hashlib.sha1 ).hexdigest() signed_url = f"{url_to_sign}&signature={signature}" url_to_request = f"{EdFestCli.base_url}{signed_url}" original_stderr = sys.stderr # Save the original stderr with open("error.log", "a") as f: sys.stderr = f # Redirect stderr to the file # Any stderr output now goes to 'error.log' print(url_to_request, file=sys.stderr) sys.stderr = original_stderr # Restore the original stderr response = requests.get(url_to_request) return response.json()
  • main.py:17-17 (registration)
    The @mcp.tool decorator registers the edinburgh_festival_venues function as an MCP tool with the description 'Search Edinburgh festival venues'.
    @mcp.tool(description="Search Edinburgh festival venues")
  • main.py:18-25 (schema)
    Input schema defined by function parameters with defaults and type hints, output as List[Dict], along with detailed docstring describing parameters and return value.
    def edinburgh_festival_venues( festival: str = "international", postcode: str = None, name: str = None, year: str = "2025", number_of_results=25, page=0, ) -> List[Dict]:

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/richarda23/edfest-mcp'

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