Skip to main content
Glama
highthon-16

MCP Calendar Server

by highthon-16

get_events_by_category

Retrieve calendar events filtered by specific categories like STUDY, WORK, REST, or ACTIVITY to organize and view related schedules efficiently.

Instructions

카테고리별로 이벤트를 조회합니다.

Args:
    category: 카테고리 (STUDY, WORK, REST, ACTIVITY)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The primary MCP tool handler for get_events_by_category. Decorated with @mcp.tool() for automatic registration. Fetches all events, filters by category, and maps to response models.
    @mcp.tool()
    def get_events_by_category(category: str) -> List[CalendarEventResponse]:
        """
        카테고리별로 이벤트를 조회합니다.
        
        Args:
            category: 카테고리 (STUDY, WORK, REST, ACTIVITY)
        """
        try:
            if category not in [cat.value for cat in EventCategory]:
                raise InvalidEventData("category", category)
            
            result = calendar_service.fetch_events(DEFAULT_USER_ID)
            if result.success and result.data:
                filtered_events = [
                    event for event in result.data 
                    if event.category == category
                ]
                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 schema for individual events returned by the tool (List[CalendarEventResponse]).
    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):
  • Enum defining valid category values used for input validation in the tool handler.
    class EventCategory(str, Enum):
        """이벤트 카테고리"""
        STUDY = "STUDY"      # 학습
        WORK = "WORK"        # 업무
        REST = "REST"        # 휴식
        ACTIVITY = "ACTIVITY" # 활동
  • src/main.py:279-280 (registration)
    MCP server startup which registers and runs all @mcp.tool() decorated functions.
    if __name__ == "__main__":
        mcp.run()
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. It states this is a retrieval operation ('조회합니다') but doesn't disclose behavioral traits like whether it's paginated, what permissions are needed, error handling, rate limits, or what the output contains. The description is minimal and lacks essential operational context.

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: a purpose statement and parameter documentation. The structure is front-loaded with the main purpose first. However, the parameter documentation could be more integrated rather than a separate 'Args:' section.

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 1 parameter with no schema documentation, the description adequately covers the parameter semantics. However, with no annotations and a retrieval operation, it should provide more behavioral context (pagination, permissions, etc.). The existence of an output schema reduces the need to describe return values, but overall completeness is minimal.

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?

With 0% schema description coverage and only 1 parameter, the description adds significant value by documenting the parameter 'category' and listing its allowed values (STUDY, WORK, REST, ACTIVITY). This compensates for the schema's lack of documentation, though it doesn't explain format or constraints beyond the enum list.

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 verb ('조회합니다' - retrieves/gets) and resource ('이벤트' - events) with the specific scope '카테고리별로' (by category). It distinguishes from siblings like get_all_events (no filtering) and get_events_by_date (different filter). However, it doesn't explicitly mention what 'events' refer to in this context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when filtering events by category, but doesn't explicitly state when to use this vs alternatives like get_all_events (unfiltered) or get_events_by_date (date-based filtering). No guidance on prerequisites, error conditions, or when-not-to-use scenarios is provided.

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