MCP Tools Reference: calendarmcp.googleapis.com

工具:suggest_time

建议一个或多个日历中的时间段。

以下示例演示了如何使用 curl 调用 suggest_time MCP 工具。

Curl 请求
curl --location 'https://calendarmcp.googleapis.com/mcp/v1' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'content-type: application/json' \
--header 'accept: application/json, text/event-stream' \
--data '{
  "method": "tools/call",
  "params": {
    "name": "suggest_time",
    "arguments": {
      // provide these details according to the tool MCP specification
    }
  },
  "jsonrpc": "2.0",
  "id": 1
}'
                

输入架构

针对 SuggestTime 的请求消息。

SuggestTimeRequest

JSON 表示法
{
  "attendeeEmails": [
    string
  ],
  "startTime": string,
  "endTime": string,

  "timeZone": string

  "durationMinutes": integer

  "preferences": {
    object (Preferences)
  }
}
字段
attendeeEmails[]

string

必需。要查找空闲时间的参加者电子邮件地址。

startTime

string

必需。查询间隔的开始时间(ISO 8601)。

endTime

string

必需。查询间隔结束时间(ISO 8601)。

联合字段 _time_zone

_time_zone 只能是下列其中一项:

timeZone

string

可选。搜索时间所用的时区(IANA ID,例如 Europe/Zurich)。默认值:start_time 的偏移量,如果没有,则为用户的主要时区。

联合字段 _duration_minutes

_duration_minutes 只能是下列其中一项:

durationMinutes

integer

可选。免费空档的最短时长(以分钟为单位)。默认值:30

联合字段 _preferences

_preferences 只能是下列其中一项:

preferences

object (Preferences)

用于查找建议时间的偏好设置。

偏好设置

JSON 表示法
{

  "startHour": string

  "endHour": string

  "excludeWeekends": boolean

  "pageSize": integer
}
字段

联合字段 _start_hour

_start_hour 只能是下列其中一项:

startHour

string

首选开始时间,采用“HH:mm”(24 小时制)格式。

联合字段 _end_hour

_end_hour 只能是下列其中一项:

endHour

string

首选结束时间,格式为“HH:mm”(24 小时制)。

联合字段 _exclude_weekends

_exclude_weekends 只能是下列其中一项:

excludeWeekends

boolean

不含周末。

联合字段 _page_size

_page_size 只能是下列其中一项:

pageSize

integer

要返回的广告资源块数量上限。默认值:5

输出架构

针对 SuggestTime 的响应消息。

SuggestTimeResponse

JSON 表示法
{
  "timeSlots": [
    {
      object (TimeSlot)
    }
  ]
}
字段
timeSlots[]

object (TimeSlot)

建议的时间空档。

TimeSlot

JSON 表示法
{
  "startTime": string,
  "endTime": string,
  "durationMinutes": integer,
  "start": {
    object (DateOrDateTime)
  },
  "end": {
    object (DateOrDateTime)
  }
}
字段
startTime
(deprecated)

string

已弃用:请改用 start

endTime
(deprecated)

string

已弃用:请改用 end

durationMinutes
(deprecated)

integer

已弃用:请改用 startend 来计算时长。

start

object (DateOrDateTime)

时间段的开始时间。

end

object (DateOrDateTime)

时间段的结束时间。

DateOrDateTime

JSON 表示法
{
  "date": string,
  "dateTime": string,
  "timeZone": string
}
字段
date

string

午夜 UTC 时间的 ISO 8601 日期(例如 '2019-11-20T00:00:00Z')。

dateTime

string

ISO 8601 时间戳(例如 '2019-11-20T08:19:06-07:00')。

timeZone

string

TZDB 时区名称。

工具注释

破坏性提示:❌ | 等幂性提示:✅ | 只读提示:✅ | 开放世界提示:❌

授权范围

需要以下 OAuth 范围之一:

  • https://www.googleapis.com/auth/calendar
  • https://www.googleapis.com/auth/calendar.readonly
  • https://www.googleapis.com/auth/calendar.events
  • https://www.googleapis.com/auth/calendar.events.freebusy
  • https://www.googleapis.com/auth/calendar.freebusy