Skip to main content
Glama
highthon-16

MCP Calendar Server

by highthon-16

create_calendar_event

Create new calendar events with title, time, duration, category, and optional stamina tracking to organize schedules systematically.

Instructions

새로운 캘린더 이벤트를 생성합니다.

Args:
    title: 이벤트 제목
    start_time: 시작 시간 (ISO 형식: 2025-08-02T10:00:00)
    duration: 지속 시간(분)
    category: 카테고리 (STUDY, WORK, REST, ACTIVITY)
    description: 이벤트 설명 (선택)
    location: 장소 (선택)
    stamina_cost: 스태미나 소모량 (기본값: 0)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYes
start_timeYes
durationYes
categoryYes
descriptionNo
locationNo
stamina_costNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
titleYes
statusYes
categoryYes
durationYes
locationNo
created_atYes
start_timeYes
descriptionNo
stamina_costYes
stamina_after_completionNo

Implementation Reference

  • The primary handler function for the 'create_calendar_event' MCP tool. It validates inputs, constructs a CalendarEventRequest, calls the CalendarService to create the event, and returns a CalendarEventResponse.
    @mcp.tool()
    def create_calendar_event(
        title: str,
        start_time: str,
        duration: int,
        category: str,
        description: Optional[str] = None,
        location: Optional[str] = None,
        stamina_cost: int = 0
    ) -> CalendarEventResponse:
        """
        새로운 캘린더 이벤트를 생성합니다.
        
        Args:
            title: 이벤트 제목
            start_time: 시작 시간 (ISO 형식: 2025-08-02T10:00:00)
            duration: 지속 시간(분)
            category: 카테고리 (STUDY, WORK, REST, ACTIVITY)
            description: 이벤트 설명 (선택)
            location: 장소 (선택)
            stamina_cost: 스태미나 소모량 (기본값: 0)
        """
        try:
            # 카테고리 유효성 검사
            if category not in [cat.value for cat in EventCategory]:
                raise InvalidEventData("category", category)
            
            # 시간 파싱
            try:
                parsed_start_time = datetime.fromisoformat(start_time.replace('Z', '+00:00'))
            except ValueError:
                raise InvalidEventData("start_time", start_time)
            
            request = CalendarEventRequest(
                title=title,
                description=description,
                location=location,
                start_time=parsed_start_time,
                duration=duration,
                category=EventCategory(category),
                stamina_cost=stamina_cost
            )
            
            result = calendar_service.create_event(request, DEFAULT_USER_ID)
            if result.success and result.data:
                return calendar_service.to_response(result.data)
            
            raise Exception(result.error or "이벤트 생성에 실패했습니다")
            
        except CalendarException:
            raise
        except Exception as e:
            raise Exception(f"이벤트 생성 중 오류가 발생했습니다: {str(e)}")
  • Pydantic model defining the input schema (CalendarEventRequest) used by the create_calendar_event handler for validation and type definitions.
    class CalendarEventRequest(BaseModel):
        """캘린더 이벤트 생성/수정 요청"""
        title: str
        description: Optional[str] = None
        location: Optional[str] = None
        start_time: datetime
        duration: int = Field(gt=0, description="지속 시간(분)")
        category: EventCategory
        stamina_cost: int = Field(ge=0, default=0, description="스태미나 소모량")
        created_at: Optional[datetime] = None
        status: Optional[EventStatus] = None
    
        @field_validator('start_time', 'created_at')
        @classmethod
        def validate_datetime(cls, v):
            if v is None:
                return v
            if isinstance(v, str):
                return datetime.fromisoformat(v.replace('Z', '+00:00'))
            return v
  • Enum defining valid categories for calendar events, used in input validation.
    class EventCategory(str, Enum):
        """이벤트 카테고리"""
        STUDY = "STUDY"      # 학습
        WORK = "WORK"        # 업무
        REST = "REST"        # 휴식
        ACTIVITY = "ACTIVITY" # 활동
  • Helper method in CalendarService that implements the core event creation logic, including time conflict detection and in-memory storage.
    def create_event(self, request: CalendarEventRequest, user_id: int) -> McpResult:
        """새 이벤트 생성"""
        try:
            # 시간 충돌 검사
            if self._has_time_conflict(request.start_time, request.duration, user_id):
                return McpResult(
                    success=False, 
                    error="해당 시간에 이미 다른 일정이 있습니다"
                )
            
            event = CalendarEvent(
                id=self.next_id,
                user_id=user_id,
                title=request.title,
                description=request.description,
                location=request.location,
                start_time=request.start_time,
                duration=request.duration,
                category=request.category,
                stamina_cost=request.stamina_cost,
                status=request.status or EventStatus.PLANNED,
                created_at=request.created_at or datetime.now()
            )
            
            self.events_db[self.next_id] = event
            self.next_id += 1
            
            return McpResult(success=True, data=event)
            
        except Exception as e:
            return McpResult(success=False, error=str(e))
  • Helper method to convert internal CalendarEvent entity to the CalendarEventResponse used in tool output.
    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
        )
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this creates events but doesn't mention authentication requirements, rate limits, what happens on conflict, whether events are immediately visible, or what the output contains. The description is minimal beyond the basic creation statement.

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 well-structured with a clear purpose statement followed by organized parameter documentation. Every sentence earns its place, though the parameter documentation could be slightly more concise.

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 that an output schema exists, the description doesn't need to explain return values. However, for a creation tool with 7 parameters and no annotations, the description should provide more behavioral context about what happens after creation, error conditions, or system constraints.

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 fully compensate. It provides detailed parameter documentation including format examples (ISO format for start_time), enum values for category, optional flags, and default values. This adds substantial meaning beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states '새로운 캘린더 이벤트를 생성합니다' (creates a new calendar event), which is a specific verb+resource combination. It distinguishes from siblings like update_calendar_event, delete_calendar_event, and various get_* tools by focusing exclusively on creation.

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?

No guidance is provided about when to use this tool versus alternatives. While the purpose is clear, there's no mention of prerequisites, when not to use it, or how it relates to sibling tools like update_calendar_event or complete_event.

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