Tool: list_drafts
Lists draft emails from the authenticated user's Gmail account.
This tool can filter drafts based on a query string and supports pagination. It returns a list of drafts, including their IDs and subjects.
The following sample demonstrate how to use curl to invoke the list_drafts MCP tool.
| Curl Request |
|---|
curl --location 'https://gmailmcp.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "list_drafts", "arguments": { // provide these details according to the tool MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
Request message for ListDrafts RPC.
ListDraftsRequest
| JSON representation |
|---|
{ "pageSize": integer "pageToken": string "query": string } |
| Fields | |
|---|---|
Union field
|
|
pageSize |
Optional. The maximum number of drafts to return. If unspecified, defaults to 20. The maximum allowed value is 50. |
Union field
|
|
pageToken |
Optional. A token received from a previous list_drafts call to retrieve the next page of results. Leave empty to fetch the first page. |
Union field
|
|
query |
Optional. A query string to filter the drafts, using the same format as the Gmail search bar. If omitted, all drafts (excluding spam and trash by default) are listed. Key Operators: from: |
Output Schema
Response message for ListDrafts RPC.
ListDraftsResponse
| JSON representation |
|---|
{
"drafts": [
{
object ( |
| Fields | |
|---|---|
drafts[] |
List of drafts. |
nextPageToken |
A token that can be used in a subsequent call to retrieve the next page of drafts. Present only if there are more results. |
Draft
| JSON representation |
|---|
{ "id": string, "subject": string, "threadId": string, "toRecipients": [ string ], "ccRecipients": [ string ], "bccRecipients": [ string ], "plaintextBody": string, "date": string } |
| Fields | |
|---|---|
id |
The unique identifier of the draft resource. |
subject |
The subject line of the draft message. |
threadId |
The ID of the thread this draft belongs to. |
toRecipients[] |
List of 'To' recipient email addresses extracted from headers. |
ccRecipients[] |
List of 'Cc' recipient email addresses extracted from headers. |
bccRecipients[] |
List of 'Bcc' recipient email addresses extracted from headers. |
plaintextBody |
Plain text body content, if available. |
date |
Date of the draft in ISO 8601 format (YYYY-MM-DD). |
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ❌ | Read Only Hint: ❌ | Open World Hint: ❌