工具:list_calendars
傳回使用者可存取的日曆 (即日曆清單)。使用這項工具將日曆識別資料 (例如「我的家庭群組日曆」) 解析為對應的 calendar_id (電子郵件 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 |
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