工具:list_calendars
返回相应用户有权访问的日历(即用户的日历列表)。使用此工具将日历标识数据(例如“我的家庭日历”)解析为相应的 calendar_id(电子邮件标识符)
以下示例演示了如何使用 curl 调用 list_calendars 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": "list_calendars", "arguments": { // provide these details according to the tool MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
输入架构
ListCalendarsRequest
| JSON 表示法 |
|---|
{ "pageSize": integer "pageToken": string } |
| 字段 | |
|---|---|
联合字段
|
|
pageSize |
可选。每页显示的结果数上限。默认值为 |
联合字段
|
|
pageToken |
可选。用于指定要返回哪个结果页面的令牌。 |
输出架构
ListCalendarsResponse
| JSON 表示法 |
|---|
{
"calendars": [
{
object ( |
| 字段 | |
|---|---|
calendars[] |
日历列表。 |
联合字段
|
|
nextPageToken |
下一页面令牌。如果不存在下一页,则省略。 |
CalendarListItem
| JSON 表示法 |
|---|
{ "id": string, "summary": string, "description": string, "timeZone": string } |
| 字段 | |
|---|---|
id |
标识符。日历的电子邮件地址。 |
summary |
仅限输出。标题。 |
description |
仅限输出。说明。 |
timeZone |
仅限输出。时区。 |
工具注释
破坏性提示:❌ | 等幂性提示:✅ | 只读提示:✅ | 开放世界提示:❌
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/calendarhttps://www.googleapis.com/auth/calendar.readonlyhttps://www.googleapis.com/auth/calendar.calendarlisthttps://www.googleapis.com/auth/calendar.calendarlist.readonly