Skip to main content
Glama
highthon-16

MCP Calendar Server

by highthon-16

get_events_by_date

Retrieve calendar events for a specific date using the MCP Calendar Server. Provide a date in YYYY-MM-DD format to view scheduled events.

Instructions

특정 날짜의 이벤트를 조회합니다.

Args:
    date: 날짜 (YYYY-MM-DD 형식)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler: @mcp.tool()-decorated function that parses the date input, fetches all events using the service, filters by date, converts to responses, and handles errors.
    @mcp.tool()
    def get_events_by_date(date: str) -> List[CalendarEventResponse]:
        """
        특정 날짜의 이벤트를 조회합니다.
        
        Args:
            date: 날짜 (YYYY-MM-DD 형식)
        """
        try:
            try:
                target_date = datetime.fromisoformat(date).date()
            except ValueError:
                raise InvalidEventData("date", date)
            
            result = calendar_service.fetch_events(DEFAULT_USER_ID)
            if result.success and result.data:
                filtered_events = [
                    event for event in result.data 
                    if event.start_time.date() == target_date
                ]
                return [calendar_service.to_response(event) for event in filtered_events]
            return []
            
        except CalendarException:
            raise
        except Exception as e:
            raise Exception(f"날짜별 이벤트 조회 중 오류가 발생했습니다: {str(e)}")
  • Pydantic model defining the output structure of CalendarEventResponse used by the get_events_by_date tool.
    class CalendarEventResponse(BaseModel):
        """캘린더 이벤트 응답"""
        id: int
        title: str
        description: Optional[str] = None
        location: Optional[str] = None
        start_time: datetime
        duration: int
        category: EventCategory
        stamina_cost: int
        status: EventStatus
        stamina_after_completion: Optional[int] = None
        created_at: datetime
    
        @field_serializer('start_time', 'created_at')
        def serialize_datetime(self, value: datetime) -> str:
            return value.isoformat()
    class ApiResponse(BaseModel):
  • Helper service method called by the tool to retrieve all events for the default user, which are then filtered by date.
    def fetch_events(self, user_id: int) -> McpResult:
        """사용자의 모든 이벤트 조회"""
        try:
            user_events = [
                event for event in self.events_db.values() 
                if event.user_id == user_id
            ]
            return McpResult(success=True, data=user_events)
        except Exception as e:
            return McpResult(success=False, error=str(e))
  • Helper service method that converts internal CalendarEvent objects to the output CalendarEventResponse format.
    def to_response(self, event: CalendarEvent) -> CalendarEventResponse:
        """Entity를 Response로 변환"""
        return CalendarEventResponse(
            id=event.id,
            title=event.title,
            description=event.description,
            location=event.location,
            start_time=event.start_time,
            duration=event.duration,
            category=event.category,
            stamina_cost=event.stamina_cost,
            status=event.status,
            stamina_after_completion=event.stamina_after_completion,
            created_at=event.created_at
        )
  • src/main.py:250-277 (registration)
    The @mcp.tool() decorator registers this function as an MCP tool.
    @mcp.tool()
    def get_events_by_date(date: str) -> List[CalendarEventResponse]:
        """
        특정 날짜의 이벤트를 조회합니다.
        
        Args:
            date: 날짜 (YYYY-MM-DD 형식)
        """
        try:
            try:
                target_date = datetime.fromisoformat(date).date()
            except ValueError:
                raise InvalidEventData("date", date)
            
            result = calendar_service.fetch_events(DEFAULT_USER_ID)
            if result.success and result.data:
                filtered_events = [
                    event for event in result.data 
                    if event.start_time.date() == target_date
                ]
                return [calendar_service.to_response(event) for event in filtered_events]
            return []
            
        except CalendarException:
            raise
        except Exception as e:
            raise Exception(f"날짜별 이벤트 조회 중 오류가 발생했습니다: {str(e)}")
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It states this is a retrieval operation ('조회'), implying read-only behavior, but doesn't specify permissions, rate limits, error handling, or what 'events' encompass (e.g., calendar events, system events). For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

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 concise with two sentences: one stating the purpose and another detailing the parameter. It's front-loaded with the core function, and every sentence adds value. However, the structure could be slightly improved by integrating the parameter info more seamlessly, but it remains efficient with zero 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 low complexity (1 parameter) and the presence of an output schema (which handles return values), the description is minimally adequate. It covers the basic purpose and parameter semantics, but lacks behavioral context (e.g., permissions, error cases) and usage guidelines relative to siblings. With no annotations, it should do more to be fully complete.

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

Parameters4/5

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

The description adds meaningful semantics beyond the input schema. The schema has 0% description coverage (only titles), but the description specifies the parameter's purpose ('날짜' meaning date) and format ('YYYY-MM-DD 형식'), which are crucial for correct usage. This compensates well for the low schema coverage, though it doesn't cover edge cases like time zones.

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: '특정 날짜의 이벤트를 조회합니다' (Retrieves events for a specific date). It specifies both the verb (조회/retrieve) and resource (이벤트/events), making the function unambiguous. However, it doesn't explicitly differentiate from sibling tools like get_all_events or get_events_by_category, which would require a 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. With siblings like get_all_events (retrieves all events) and get_events_by_category (retrieves by category), the agent must infer usage based on the name alone. No explicit when/when-not instructions or alternative mentions are included.

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/highthon-16/MCP'

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