MCP Tools Reference: chatmcp.googleapis.com

เครื่องมือ: send_message

ส่งข้อความ Google Chat ไปยังการสนทนา

เครื่องมือนี้ใช้รหัสการสนทนา รหัสเธรด (ไม่บังคับ) และข้อความเป็นอินพุต คุณดูรหัสการสนทนาได้โดยใช้เครื่องมือ search_conversations โดยจะแสดงข้อความที่สร้างขึ้น

ตัวอย่างต่อไปนี้แสดงวิธีใช้ curl เพื่อเรียกใช้เครื่องมือ send_message MCP

คำขอ Curl
curl --location 'https://chatmcp.googleapis.com/mcp/v1' \
--header 'content-type: application/json' \
--header 'accept: application/json, text/event-stream' \
--data '{
  "method": "tools/call",
  "params": {
    "name": "send_message",
    "arguments": {
      // provide these details according to the tool MCP specification
    }
  },
  "jsonrpc": "2.0",
  "id": 1
}'
                

สคีมาอินพุต

ขอส่งข้อความไปยังการสนทนาใน Google Chat

SendMessageRequest

การแสดง JSON
{
  "conversationId": string,
  "threadId": string,
  "messageText": string
}
ช่อง
conversationId

string

ต้องระบุ รหัสของการสนทนา (เช่น "spaces/AAAA...") ที่จะส่งข้อความไป

threadId

string

ไม่บังคับ รหัสของเธรด (เช่น "spaces/AAAA.../threads/BBBB...") ที่จะส่งข้อความไป หากไม่ได้ตั้งค่าไว้ ระบบจะส่งข้อความไปยังเธรดใหม่

messageText

string

ต้องระบุ เนื้อหาหลักของข้อความ คุณเพิ่มการจัดรูปแบบพื้นฐานได้โดยใช้ชุดย่อยของมาร์กดาวน์ ดูข้อมูลเกี่ยวกับวิธีจัดรูปแบบข้อความได้ที่จัดรูปแบบข้อความ ระบบรองรับการจัดรูปแบบต่อไปนี้

  • ตัวหนา: *text*
  • ตัวเอียง: _text_
  • ขีดทับ: ~text~
  • Monospace: text
  • บล็อกแบบ Monospace:
```
line 1
line 2
```
  • รายการสัญลักษณ์หัวข้อย่อย:
* item 1
* item 2
  • ข้อความที่ยกมา: > quoted text
  • ไฮเปอร์ลิงก์: <url|display text>
  • กล่าวถึงผู้ใช้: <users/{user_id}>

สคีมาเอาต์พุต

การตอบกลับเมื่อส่งข้อความไปยังการสนทนาใน Google Chat

SendMessageResponse

การแสดง JSON
{
  "message": {
    object (ChatMessage)
  }
}
ช่อง
message

object (ChatMessage)

ข้อความที่ส่ง

ChatMessage

การแสดง JSON
{
  "messageId": string,
  "threadId": string,
  "plaintextBody": string,
  "sender": {
    object (User)
  },
  "createTime": string,
  "threadedReply": boolean,
  "attachments": [
    {
      object (ChatAttachmentMetadata)
    }
  ],
  "reactionSummaries": [
    {
      object (ReactionSummary)
    }
  ]
}
ช่อง
messageId

string

ชื่อทรัพยากรของข้อความ รูปแบบ: spaces/{space}/messages/{message}

threadId

string

ชุดข้อความที่ข้อความนี้เป็นของ ฟิลด์นี้จะว่างเปล่าหากข้อความไม่ได้อยู่ในชุดข้อความ รูปแบบ: spaces/{space}/threads/{thread}

plaintextBody

string

เนื้อหาข้อความแบบข้อความธรรมดา

sender

object (User)

ผู้ส่งข้อความ

createTime

string

เอาต์พุตเท่านั้น การประทับเวลาเมื่อสร้างข้อความ

threadedReply

boolean

ไม่ว่าข้อความจะเป็นการตอบกลับชุดข้อความหรือไม่

attachments[]

object (ChatAttachmentMetadata)

ไฟล์แนบที่รวมอยู่ในข้อความ

reactionSummaries[]

object (ReactionSummary)

สรุปรีแอ็กชันด้วยอีโมจิที่รวมอยู่ในข้อความ

ผู้ใช้

การแสดง JSON
{
  "userId": string,
  "displayName": string,
  "email": string,
  "userType": enum (UserType)
}
ช่อง
userId

string

ชื่อทรัพยากรของผู้ใช้ Chat รูปแบบ: users/{user}

displayName

string

ชื่อที่แสดงของผู้ใช้ Chat

email

string

อีเมลของผู้ใช้ ระบบจะป้อนข้อมูลในช่องนี้เมื่อประเภทผู้ใช้เป็น HUMAN เท่านั้น

userType

enum (UserType)

ประเภทของผู้ใช้

ChatAttachmentMetadata

การแสดง JSON
{
  "attachmentId": string,
  "filename": string,
  "mimeType": string,
  "source": enum (Source)
}
ช่อง
attachmentId

string

ชื่อทรัพยากรของไฟล์แนบ รูปแบบ: spaces/{space}/messages/{message}/attachments/{attachment}

filename

string

ชื่อไฟล์แนบ

mimeType

string

ประเภทเนื้อหา (ประเภท MIME)

source

enum (Source)

แหล่งที่มาของไฟล์แนบ

ReactionSummary

การแสดง JSON
{
  "emoji": string,
  "count": integer
}
ช่อง
emoji

string

สตริง Unicode อีโมจิหรือชื่ออีโมจิที่กำหนดเอง

count

integer

จำนวนรีแอ็กชันทั้งหมดที่ใช้อีโมจิที่เชื่อมโยง

UserType

ประเภทผู้ใช้ Google Chat

Enum
USER_TYPE_UNSPECIFIED ไม่ระบุ
HUMAN ผู้ใช้ที่เป็นบุคคล
APP ผู้ใช้แอป

แหล่งที่มา

แหล่งที่มาของไฟล์แนบ

Enum
SOURCE_UNSPECIFIED สงวนสิทธิ์
DRIVE_FILE ไฟล์เป็นไฟล์ใน Google ไดรฟ์
UPLOADED_CONTENT ระบบจะอัปโหลดไฟล์ไปยัง Chat

คำอธิบายประกอบเครื่องมือ

คำใบ้ที่ทำลาย: ❌ | คำใบ้ที่ทำซ้ำได้: ❌ | คำใบ้แบบอ่านอย่างเดียว: ❌ | คำใบ้แบบโลกเปิด: ✅