We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/alejofig/mcp-berghain'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
models.py•1.42 KiB
from typing import List, Optional
from datetime import datetime
from pydantic import BaseModel, Field
import uuid
class EventBase(BaseModel):
"""Base model for event data"""
date: datetime
title: str
location: str
url: Optional[str] = None
class EventCreate(EventBase):
"""Model for creating a new event"""
artists: List[str] = Field(default_factory=list)
class Event(EventBase):
"""Model for a complete event"""
id: str = Field(default_factory=lambda: str(uuid.uuid4()))
artists: List[str] = Field(default_factory=list)
year_month: Optional[str] = None
year: Optional[int] = None
month: Optional[int] = None
def __init__(self, **data):
super().__init__(**data)
# Populate computed fields
if self.date:
self.year_month = self.date.strftime("%Y_%m")
self.year = self.date.year
self.month = self.date.month
class Config:
orm_mode = True # For Pydantic v1 compatibility
class EventResponse(BaseModel):
"""Response model with pagination information"""
items: List[Event]
total: int
page: int
size: int
class ArtistResponse(BaseModel):
"""Response model for artist information"""
name: str
event_count: int
events: List[Event]
class LocationResponse(BaseModel):
"""Response model for location information"""
name: str
event_count: int
events: List[Event]