MCP Tools Reference: calendarmcp.googleapis.com

工具: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
}
欄位

聯集欄位 _page_size

_page_size 只能是下列其中一項:

pageSize

integer

(選用步驟) 每頁最多顯示的結果數。預設 100,最多 250

聯集欄位 _page_token

_page_token 只能是下列其中一項:

pageToken

string

(選用步驟) 指定要傳回哪個結果頁面的符記。

輸出內容的結構定義

ListCalendarsResponse

JSON 表示法
{
  "calendars": [
    {
      object (CalendarListItem)
    }
  ],

  "nextPageToken": string
}
欄位
calendars[]

object (CalendarListItem)

日曆清單。

聯集欄位 _next_page_token

_next_page_token 只能是下列其中一項:

nextPageToken

string

下一頁符記。如果沒有下一頁,則省略這個欄位。

CalendarListItem

JSON 表示法
{
  "id": string,
  "summary": string,
  "description": string,
  "timeZone": string
}
欄位
id

string

ID。日曆的電子郵件地址。

summary

string

僅供輸出。標題。

description

string

僅供輸出。說明:

timeZone

string

僅供輸出。時區。

工具註解

破壞性提示:❌ | 等冪提示:✅ | 唯讀提示:✅ | 開放世界提示:❌

授權範圍

需要下列其中一種 OAuth 範圍:

  • https://www.googleapis.com/auth/calendar
  • https://www.googleapis.com/auth/calendar.readonly
  • https://www.googleapis.com/auth/calendar.calendarlist
  • https://www.googleapis.com/auth/calendar.calendarlist.readonly