X Direct Messages
x_dmsSend, read, and delete X Direct Messages: message users or existing conversations, list recent DM events, and fetch conversation history by conversation or user.
Instructions
Send and read Direct Messages: send to a user or an existing conversation, read events, read a conversation, and delete an event.
Actions (pass "action" plus that action's parameters):
send: Send a DM to a user, creating the 1:1 conversation if needed. [requires: text]
send_to_conversation: Send a message to an existing DM conversation by conversation id. [requires: conversation_id, text]
events: Recent Direct Message events across all conversations, newest first (1-100 per page).
conversation: Messages in one DM conversation, newest first (1-100 per page). [requires: conversation_id]
with_user: Messages exchanged with one user, newest first (1-100 per page).
delete: Delete a Direct Message event sent by the authenticated account. [requires: event_id]
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"action": "<action>"
},
"name": "x_dms"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | Message text. | |
| action | Yes | Action to perform. One of: send, send_to_conversation, events, conversation, with_user, delete. | |
| user_id | No | Numeric X user id. | |
| event_id | No | Numeric DM event id. | |
| media_id | No | Optional media id uploaded with category dm_image or dm_video. | |
| username | No | X handle without the @ prefix. | |
| next_token | No | Cursor from a previous response (meta.next_token). | |
| event_types | No | Filter by event type, e.g. MessageCreate, ParticipantsJoin, ParticipantsLeave. | |
| max_results | No | ||
| conversation_id | No |