Skip to main content
Glama
highthon-16

MCP Calendar Server

by highthon-16

get_event_by_id

Retrieve specific calendar events by their unique ID to view details, manage schedules, or integrate with other systems.

Instructions

ID로 특정 캘린더 이벤트를 조회합니다.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
event_idYes

Output Schema

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

Implementation Reference

  • The MCP tool handler for 'get_event_by_id', decorated with @mcp.tool(). It calls the calendar service, handles errors, and returns a CalendarEventResponse.
    @mcp.tool()
    def get_event_by_id(event_id: int) -> CalendarEventResponse:
        """
        ID로 특정 캘린더 이벤트를 조회합니다.
        """
        try:
            result = calendar_service.get_event_by_id(event_id, DEFAULT_USER_ID)
            if result.success and result.data:
                return calendar_service.to_response(result.data)
            raise EventNotFound(event_id)
        except CalendarException:
            raise
        except Exception as e:
            raise Exception(f"이벤트 조회 중 오류가 발생했습니다: {str(e)}")
  • Pydantic BaseModel defining the output schema (CalendarEventResponse) used by the get_event_by_id 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):
  • Supporting service method that implements the core logic: fetches event from in-memory DB, authorizes user, and returns McpResult.
    def get_event_by_id(self, event_id: int, user_id: int) -> McpResult:
        """ID로 특정 이벤트 조회"""
        try:
            if event_id not in self.events_db:
                raise EventNotFound(event_id)
            
            event = self.events_db[event_id]
            if event.user_id != user_id:
                raise UnauthorizedAccess(user_id, event_id)
            
            return McpResult(success=True, data=event)
            
        except CalendarException:
            raise
        except Exception as e:
            return McpResult(success=False, error=str(e))
  • src/main.py:42-55 (registration)
    The @mcp.tool() decorator registers the get_event_by_id function as an MCP tool.
    @mcp.tool()
    def get_event_by_id(event_id: int) -> CalendarEventResponse:
        """
        ID로 특정 캘린더 이벤트를 조회합니다.
        """
        try:
            result = calendar_service.get_event_by_id(event_id, DEFAULT_USER_ID)
            if result.success and result.data:
                return calendar_service.to_response(result.data)
            raise EventNotFound(event_id)
        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 the full burden of behavioral disclosure. It states this is a retrieval operation ('조회'), which implies read-only behavior, but doesn't clarify aspects like authentication requirements, error handling (e.g., what happens if the ID is invalid), rate limits, or response format. 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.

Conciseness5/5

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

The description is a single, efficient sentence in Korean that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, with every part contributing to understanding the core functionality. There is no wasted text or redundancy.

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 (single parameter, no nested objects) and the presence of an output schema (which handles return values), the description is minimally adequate. However, with no annotations and 0% schema description coverage, it lacks details on behavioral aspects like error handling or authentication. It meets basic needs but has clear gaps for a retrieval tool.

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

Parameters3/5

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

The description adds minimal meaning beyond the input schema. It indicates that the 'event_id' parameter is used to retrieve a specific event, but with 0% schema description coverage, the schema only defines the parameter as an integer without context. The description doesn't compensate by explaining what the ID represents (e.g., numeric identifier from the system) or format expectations. Baseline is 3 due to the single parameter, but it doesn't fully address the coverage gap.

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: 'ID로 특정 캘린더 이벤트를 조회합니다' (Retrieve a specific calendar event by ID). It specifies the verb (retrieve/조회), resource (calendar event/캘린더 이벤트), and key constraint (by ID/ID로). However, it doesn't explicitly distinguish this from sibling tools like 'get_all_events' or 'get_events_by_category' beyond the ID focus.

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. It doesn't mention scenarios where this is preferred over other retrieval tools (e.g., 'get_all_events' for bulk access or 'get_events_by_date' for date-based queries), nor does it specify prerequisites like needing a valid event ID. Usage is implied by the description but not explicitly stated.

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