MCP Reference: calendarmcp.googleapis.com

Model Context Protocol (MCP) 服务器充当外部服务(为大语言模型 [LLM] 或 AI 应用提供上下文、数据或功能)与 LLM 或 AI 应用之间的代理。MCP 服务器将 AI 应用连接到数据库和 Web 服务等外部系统,并将这些系统的响应转换为 AI 应用可理解的格式。

MCP 工具

MCP 工具是 MCP 服务器向 LLM 或 AI 应用公开的函数或可执行功能,用于在现实世界中执行操作。

calendarmcp.googleapis.com MCP 服务器具有以下工具:

MCP 工具
list_events

列出给定日历中满足给定条件的日历活动。

主要特性:

  • 任何日历 ID,可以是用户的主日历或其他日历。
  • 关键字匹配。
  • 时间范围过滤。
  • 检索符合时间和关键字限制条件的所有活动。

如果符合以下条件,请改用 search_events 工具:

  • 您需要找到(前 K 个)最相关的事件,而不是满足约束条件的所有事件。
  • 您需要语义搜索功能。
  • 您仅在用户的主日历中搜索特定信息。

此工具适用于以下类型的查询:

  • 我的日历上明天有什么安排?
  • 我的日历上 2025 年 7 月 14 日有什么安排?
  • 我下周有哪些会议?
  • 我今天下午有任何冲突吗?

示例:

list_events(
    start_time='2024-09-17T06:00:00',
    end_time='2024-09-17T12:00:00',
    page_size=10
)
# Returns up to 10 calendar events between 6:00 AM and 12:00 PM on September 17, 2024 from the user's primary calendar.
get_event

返回指定日历中的单个活动。

此工具适用于以下类型的查询:

  • 获取团队会议的详细信息。
  • 在我的日历中显示 ID 为 event123 的活动。

示例:

get_event(
    event_id='event123'
)
# Returns the event details for the event with id `event123` on the user's primary calendar.
list_calendars

返回用户日历列表中的日历。

此工具适用于以下类型的查询:

  • 我的所有日历有哪些?

示例:

list_calendars()
# Returns all calendars the authenticated user has access to.
suggest_time

建议一个或多个日历中的时间段。如需访问主日历,请在 attendee_emails 字段中添加“primary”。

此工具适用于以下类型的查询:

  • 我们所有人什么时候都有空开会?
  • 找一个我们两人都有空的 30 分钟时间段。
  • 查看 jane.doe@google.com 是否在周一上午有空。

示例:

suggest_time(
    attendee_emails=['joedoe@gmail.com', 'janedoe@gmail.com'],
    start_time='2024-09-10T00:00:00',
    end_time='2024-09-17T00:00:00',
    duration_minutes=60,
    preferences={
        'start_hour': '09:00',
        'end_hour': '17:00',
        'exclude_weekends': True
    }
)
# Returns up to 5 suggested time slots where both users are available for at least one hour between 9:00 AM and 5:00 PM on weekdays from September 10 through September 16, 2024.
create_event

创建日历活动。

此工具适用于以下类型的查询:

  • 在我的日历上创建一项活动,活动名称为“与 Jane 会面”,时间为明天下午 2 点。
  • 安排下周一上午 10 点到 11 点与 john.doe@google.com 开会。

示例:

create_event(
    summary='Meeting with Jane',
    start_time='2024-09-17T14:00:00',
    end_time='2024-09-17T15:00:00'
)
# Creates an event on the primary calendar for September 17, 2024 from 2pm to 3pm called 'Meeting with Jane'.
update_event

更新日历活动。

此工具适用于以下类型的查询:

  • 将“与 Jane 的会议”活动更新为一小时后。
  • john.doe@google.com 添加到明天的会议中。

示例:

update_event(
    event_id='event123',
    summary='Meeting with Jane and John'
)
# Updates the summary of event with id 'event123' on the primary calendar to 'Meeting with Jane and John'.
delete_event

删除日历活动。

此工具适用于以下类型的查询:

  • 删除我日历中 ID 为 event123 的活动。

如需取消或拒绝活动,请改用 respond_to_event 工具。

示例:

delete_event(
    event_id='event123'
)
# Deletes the event with id 'event123' on the user's primary calendar.
respond_to_event

响应事件。

此工具适用于以下类型的查询:

  • 接受我日历上 ID 为 event123 的活动。
  • 拒绝与 Jane 的会议。
  • 取消我的下一次会议。
  • 暂时接受规划会议。

示例:

respond_to_event(
    event_id='event123',
    response_status='accepted'
)
# Responds with status 'accepted' to the event with id 'event123' on the user's primary calendar.

获取 MCP 工具规范

如需获取 MCP 服务器中所有工具的 MCP 工具规范,请使用 tools/list 方法。下面的示例演示了如何使用 curl 列出 MCP 服务器中当前可用的所有工具及其规范。

Curl 请求
curl --location 'https://calendarmcp.googleapis.com/mcp' \
--header 'content-type: application/json' \
--header 'accept: application/json, text/event-stream' \
--data '{
    "method": "tools/list",
    "jsonrpc": "2.0",
    "id": 1
}'