Open Context Protocol is live! 🚀 Read the launch post
chatScheduleMessage

chatScheduleMessage

Schedules a message to be sent to a channel.

Details

  • Method: POST
  • Path: /chat.scheduleMessage
  • Operation ID: chat_scheduleMessage

Parameters

{
  "token": {
    "description": "Authentication token. Requires scope: `chat:write`",
    "required": false,
    "location": "header",
    "type": "string"
  },
  "channel": {
    "description": "Channel, private group, or DM channel to send message to. Can be an encoded ID, or a name. See [below](#channels) for more details.",
    "required": false,
    "location": "formData",
    "type": "string"
  },
  "text": {
    "description": "How this field works and whether it is required depends on other fields you use in your API call. [See below](#text_usage) for more detail.",
    "required": false,
    "location": "formData",
    "type": "string"
  },
  "post_at": {
    "description": "Unix EPOCH timestamp of time in future to send the message.",
    "required": false,
    "location": "formData",
    "type": "string"
  },
  "parse": {
    "description": "Change how messages are treated. Defaults to `none`. See [chat.postMessage](chat.postMessage#formatting).",
    "required": false,
    "location": "formData",
    "type": "string"
  },
  "as_user": {
    "description": "Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See [chat.postMessage](chat.postMessage#authorship).",
    "required": false,
    "location": "formData",
    "type": "string"
  },
  "link_names": {
    "description": "Find and link channel names and usernames.",
    "required": false,
    "location": "formData",
    "type": "string"
  },
  "attachments": {
    "description": "A JSON-based array of structured attachments, presented as a URL-encoded string.",
    "required": false,
    "location": "formData",
    "type": "string"
  },
  "blocks": {
    "description": "A JSON-based array of structured blocks, presented as a URL-encoded string.",
    "required": false,
    "location": "formData",
    "type": "string"
  },
  "unfurl_links": {
    "description": "Pass true to enable unfurling of primarily text-based content.",
    "required": false,
    "location": "formData",
    "type": "string"
  },
  "unfurl_media": {
    "description": "Pass false to disable unfurling of media content.",
    "required": false,
    "location": "formData",
    "type": "string"
  },
  "thread_ts": {
    "description": "Provide another message's `ts` value to make this message a reply. Avoid using a reply's `ts` value; use its parent instead.",
    "required": false,
    "location": "formData",
    "type": "string"
  },
  "reply_broadcast": {
    "description": "Used in conjunction with `thread_ts` and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to `false`.",
    "required": false,
    "location": "formData",
    "type": "string"
  }
}

Response Schema

{
  "additionalProperties": false,
  "description": "Schema for successful response of chat.scheduleMessage method",
  "properties": {
    "channel": {
      "pattern": "^[CGD][A-Z0-9]{8,}$",
      "title": "Channel-like conversation ID",
      "type": "string"
    },
    "message": {
      "additionalProperties": false,
      "properties": {
        "bot_id": {
          "pattern": "^B[A-Z0-9]{8,}$",
          "title": "Bot User ID",
          "type": "string"
        },
        "bot_profile": {
          "additionalProperties": false,
          "properties": {
            "app_id": {
              "pattern": "^A[A-Z0-9]{1,}$",
              "title": "App ID",
              "type": "string"
            },
            "deleted": {
              "type": "boolean"
            },
            "icons": {
              "additionalProperties": false,
              "properties": {
                "image_36": {
                  "format": "uri",
                  "type": "string"
                },
                "image_48": {
                  "format": "uri",
                  "type": "string"
                },
                "image_72": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "required": [
                "image_36",
                "image_48",
                "image_72"
              ],
              "type": "object"
            },
            "id": {
              "pattern": "^B[A-Z0-9]{8,}$",
              "title": "Bot User ID",
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "team_id": {
              "pattern": "^[T][A-Z0-9]{2,}$",
              "title": "Team ID",
              "type": "string"
            },
            "updated": {
              "type": "integer"
            }
          },
          "required": [
            "id",
            "deleted",
            "name",
            "updated",
            "app_id",
            "icons",
            "team_id"
          ],
          "title": "Bot Profile Object",
          "type": "object"
        },
        "team": {
          "pattern": "^[T][A-Z0-9]{2,}$",
          "title": "Team ID",
          "type": "string"
        },
        "text": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "user": {
          "pattern": "^[UW][A-Z0-9]{2,}$",
          "title": "User ID",
          "type": "string"
        },
        "username": {
          "type": "string"
        }
      },
      "required": [
        "type",
        "text",
        "bot_id",
        "user",
        "team"
      ],
      "type": "object"
    },
    "ok": {
      "enum": [
        true
      ],
      "title": "default success response",
      "type": "boolean"
    },
    "post_at": {
      "pattern": "^\\d{10}$",
      "type": "integer"
    },
    "scheduled_message_id": {
      "pattern": "^[Q][A-Z0-9]{8,}$",
      "title": "Scheduled Message ID",
      "type": "string"
    }
  },
  "required": [
    "ok",
    "channel",
    "post_at",
    "scheduled_message_id",
    "message"
  ],
  "title": "chat.scheduleMessage success schema",
  "type": "object"
}

Usage

from ocp_agent import OCPAgent

agent = OCPAgent()
await agent.register_api('slack')

# Call this tool
result = await agent.call_tool('chatScheduleMessage', {
    # Add required parameters here
})