所有工具

teams_send_message

Microsoft Teams · macOS · Windows

效果: 发送. 状态: 受限可用.

“受限可用”表示工具可能取决于版本、平台、权限、账户或配置,并不表示它在所有安装中都已启用。

macOS

用途

向 Microsoft Teams 聊天或频道发送文本消息。 需要 Microsoft Teams 正在运行且已登录(每次调用都会从 Teams 的本地 Cookie 中重新读取令牌)。chat_id 必须来自之前的 teams_list_chats 调用,绝不能编造 ID。这是一项写入操作:首次调用返回预览,第二次调用(带 confirm=true)才实际发送。sent:true 表示已从会话中回读该消息(投递已验证);应信任这个字段,而不是后续读取结果。teams_search_messages 和 teams_read_chat_messages 读取 Teams 自己的本地同步索引,该索引可能比已验证的发送延迟数分钟(单次观察案例为 3 分钟,#2285)。发送后紧接着的同级读取返回零条结果,并不能证明发送失败。status 为“sent_unconfirmed”的响应表示服务器已接受 POST,但无法验证消息;请告知用户打开 Teams 本身进行检查,再判断收件人是否已收到通知。

必填输入

输入名称会严格保持工具要求的形式。下方可展开的架构中保留英文规范技术定义。

权限与确认

架构声明了明确的确认参数。请检查预览,并按此平台的契约授权实际操作。

英文规范技术架构macOS
{
  "properties": {
    "chat_id": {
      "description": "Thread id from teams_list_chats (e.g. '19:<uuid>_<uuid>@unq.gbl.spaces' for 1:1, '19:<uuid>@thread.tacv2' for group)",
      "type": "string"
    },
    "confirm": {
      "description": "Must be true to actually send. Without it, returns a preview without making any network call.",
      "type": "boolean"
    },
    "text": {
      "description": "Plain-text message body. Max 28000 chars. No formatting / mentions / attachments in v1.",
      "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。首次调用返回预览;设置 confirm=true 才会发送。

必填输入

输入名称会严格保持工具要求的形式。下方可展开的架构中保留英文规范技术定义。

权限与确认

架构声明了明确的确认参数。请检查预览,并按此平台的契约授权实际操作。

英文规范技术架构Windows
{
  "properties": {
    "chat_id": {
      "description": "Chat ID from teams_list_chats",
      "type": "string"
    },
    "confirm": {
      "description": "Set true to send; false returns preview",
      "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?"
}