Open Context Protocol is live! 🚀 Read the launch post

chatDelete

Deletes a message.

Details

  • Method: POST
  • Path: /chat.delete
  • Operation ID: chat_delete

Parameters

{
  "token": {
    "description": "Authentication token. Requires scope: `chat:write`",
    "required": false,
    "location": "header",
    "type": "string"
  },
  "ts": {
    "description": "Timestamp of the message to be deleted.",
    "required": false,
    "location": "formData",
    "type": "string"
  },
  "channel": {
    "description": "Channel containing the message to be deleted.",
    "required": false,
    "location": "formData",
    "type": "string"
  },
  "as_user": {
    "description": "Pass true to delete the message as the authed user with `chat:write:user` scope. [Bot users](/bot-users) in this context are considered authed users. If unused or false, the message will be deleted with `chat:write:bot` scope.",
    "required": false,
    "location": "formData",
    "type": "string"
  }
}

Response Schema

{
  "additionalProperties": false,
  "description": "Schema for successful response of chat.delete method",
  "properties": {
    "channel": {
      "pattern": "^[CGD][A-Z0-9]{8,}$",
      "title": "Channel-like conversation ID",
      "type": "string"
    },
    "ok": {
      "enum": [
        true
      ],
      "title": "default success response",
      "type": "boolean"
    },
    "ts": {
      "pattern": "^\\d{10}\\.\\d{6}$",
      "title": "Timestamp in format 0123456789.012345",
      "type": "string"
    }
  },
  "required": [
    "ok",
    "channel",
    "ts"
  ],
  "title": "chat.delete 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('chatDelete', {
    # Add required parameters here
})