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. page_token can be used to paginate the results. To retrieve subsequent pages of results, use the page_token returned in the previous response.
The following sample demonstrate how to use curl to invoke the list_drafts MCP tool.
| Curl Request |
|---|
curl --location 'https://gmailmcp.googleapis.com/mcp/v1' \ --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's 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. This is primarily used for pagination to continue fetching results from where the previous |
Union field
|
|
query |
Examples: "subject:OneMCP Update" "from:gduser1@workspacesamples.dev" "to:gduser2@workspacesamples.dev AND newer_than:7d" "project proposal has:attachment" "is:unread" A space or a dash ( Note: If we want to ensure all drafts for the query are returned, we can paginate the results by making repeated calls to the tool until the response contains an empty list of drafts. |
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. If the number of drafts matching the query exceeds the page_size limit, the response will contain a |
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: ❌