teams_send_message
Microsoft Teams · macOS · Windows
效果: 发送. 状态: 受限可用.
“受限可用”表示工具可能取决于版本、平台、权限、账户或配置,并不表示它在所有安装中都已启用。
macOS
用途
以已连接的 Microsoft 365 工作或学校账户(connect_m365_account)的身份,通过 Microsoft 365 向 Microsoft Teams 聊天发送文本消息。chat_id 必须来自同一账户的 teams_list_chats——绝不要编造 id。这是一项写入操作:首次调用返回预览,说明聊天中有哪些人(或说明无法读取:chat_unresolved),第二次调用(带 confirm=true)才会实际发送。确认之前请向用户展示这些参与者,尤其是当 participants_state 不是 "resolved" 或 has_external_members 为 true 时。sent:true 表示 Microsoft 已接受该消息;teams_search_messages 读取的是 Microsoft 的搜索索引,可能落后于发送,因此刚发送后搜索结果为零并不能证明发送失败。
必填输入
chat_idtext
输入名称会严格保持工具要求的形式。下方可展开的架构中保留英文规范技术定义。
权限与确认
架构声明了明确的确认参数。请检查预览,并按此平台的契约授权实际操作。
- 仅使用用户在此平台上授权的应用、账户和资源。请查阅此工具针对平台的说明,以了解其连接和权限要求;本目录不声称需要额外的 OAuth 范围或操作系统授权。
英文规范技术架构 — macOS
{
"properties": {
"account": {
"description": "Which connected Microsoft 365 account to use: its email (UPN), its id from list_m365_accounts, or its display name when unique. Leave it out to use the default account.",
"type": "string"
},
"chat_id": {
"description": "Chat id from teams_list_chats (e.g. '19:<uuid>_<uuid>@unq.gbl.spaces' for 1:1, '19:<id>@thread.v2' for a group)",
"type": "string"
},
"confirm": {
"description": "Must be true to actually send. Without it, returns a preview and sends nothing: the preview reads who is in the chat (`chat`: title, participants, participant_count, participants_state, has_external_members), or says chat_unresolved when that could not be read.",
"type": "boolean"
},
"text": {
"description": "Plain-text message body. Max 28000 chars. No formatting / mentions / attachments.",
"type": "string"
}
},
"required": [
"chat_id",
"text"
],
"type": "object"
}文档示例
teams_send_message 的文档示例。请勿执行此示例。所示参数属于虚构数据集;在实际调用前,请解析真实标识符并获得授权。
{
"chat_id": "demo-chat-001",
"confirm": false,
"text": "Can we review the launch checklist on Tuesday?"
}Windows
用途
通过 Graph API 向 Microsoft Teams 聊天发送消息。需要 connect_m365_account。chat_id 必须来自 teams_list_chats。首次调用返回预览,说明聊天中有哪些人(或说明无法读取:chat_unresolved);设置 confirm=true 才会发送。确认之前请向用户展示这些参与者,尤其是当 participants_state 不是 "resolved" 或 has_external_members 为 true 时。
必填输入
chat_idtext
输入名称会严格保持工具要求的形式。下方可展开的架构中保留英文规范技术定义。
权限与确认
架构声明了明确的确认参数。请检查预览,并按此平台的契约授权实际操作。
- 仅使用用户在此平台上授权的应用、账户和资源。请查阅此工具针对平台的说明,以了解其连接和权限要求;本目录不声称需要额外的 OAuth 范围或操作系统授权。
英文规范技术架构 — Windows
{
"properties": {
"account": {
"description": "Which connected Microsoft 365 account to use: its email (UPN), its id from list_m365_accounts, or its display name when unique. Leave it out to use the default account.",
"type": "string"
},
"chat_id": {
"description": "Chat ID from teams_list_chats",
"type": "string"
},
"confirm": {
"description": "Must be true to actually send. Without it, returns a preview and sends nothing: the preview reads who is in the chat (`chat`: title, participants, participant_count, participants_state, has_external_members), or says chat_unresolved when that could not be read.",
"type": "boolean"
},
"text": {
"description": "Plain-text message body",
"type": "string"
}
},
"required": [
"chat_id",
"text"
],
"type": "object"
}文档示例
teams_send_message 的文档示例。请勿执行此示例。所示参数属于虚构数据集;在实际调用前,请解析真实标识符并获得授权。
{
"chat_id": "demo-chat-001",
"confirm": false,
"text": "Can we review the launch checklist on Tuesday?"
}