工具:get_thread
从经过身份验证的用户的 Gmail 账号中检索特定电子邮件会话,包括其邮件列表。
以下示例演示了如何使用 curl 调用 get_thread MCP 工具。
| Curl 请求 |
|---|
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": "get_thread", "arguments": { // provide these details according to the tool MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
输入架构
针对 GetThread RPC 的请求消息。
GetThreadRequest
| JSON 表示法 |
|---|
{
"threadId": string,
"messageFormat": enum ( |
| 字段 | |
|---|---|
threadId |
必需。要提取的线程的唯一标识符。 |
messageFormat |
可选。指定线程中返回的消息的格式。默认值为 FULL_CONTENT。 |
输出架构
包含消息列表的线程。
会话
| JSON 表示法 |
|---|
{
"id": string,
"messages": [
{
object ( |
| 字段 | |
|---|---|
id |
线程的唯一标识符。 |
messages[] |
相应线程中的消息列表,按时间顺序排序。 |
消息
| JSON 表示法 |
|---|
{ "id": string, "snippet": string, "subject": string, "sender": string, "toRecipients": [ string ], "ccRecipients": [ string ], "date": string, "plaintextBody": string } |
| 字段 | |
|---|---|
id |
消息的唯一标识符。 |
snippet |
消息正文的简短内容。 |
subject |
从标头中提取的邮件主题: |
sender |
发件人的电子邮件地址。 |
toRecipients[] |
收件人电子邮件地址。 |
ccRecipients[] |
抄送收件人的电子邮件地址。 |
date |
消息的日期,采用 ISO 8601 格式 (YYYY-MM-DD)。 |
plaintextBody |
完整正文内容,仅在 MessageFormat 为 FULL_CONTENT 时填充。 |
工具注释
破坏性提示:❌ | 等幂性提示:✅ | 只读提示:✅ | 开放世界提示:❌