Matrix Message Full Semantics
This page is the complete reference for the matrix_message tool.
The model-facing tool description is a condensed summary of these semantics.
Send, reply, react to, read, edit, or inspect Matrix messages using current room and thread context defaults.
Actions
- send: Send text and optional attachments to a room.
It defaults to the current room.
When the effective target is room-level, text+attachment sends post the text to the room timeline and thread attachments under that text event.
When the effective target is room-level and you send multiple attachments without text, the first attachment is posted to the room timeline and the remaining attachments are threaded under it.
In
thread_mode: room, room-level sends stay plain room messages and do not auto-thread attachments unless you pass an explicitthread_id. - reply: Send text and optional attachments into a thread. It defaults to the current thread when one can be resolved and errors if no thread is available.
- thread-reply: Same threading behavior as
reply, kept as a separate action name for agent convenience. - react: React to
targetwithmessageas the emoji, defaulting to thumbs-up whenmessageis empty. - read: Read recent messages from the current thread when one is active, otherwise from the room timeline.
An edited message is reported once, at its newest revision, with
event_idnaming the original andlatest_event_idnaming the revision on screen. A room-timeline read still asks the homeserver forlimitraw events, so a heavily edited stretch of the room returns fewer thanlimitmessages. A room-timeline read whose window holds a revision but not the message it revises cannot tell where that message lives, and reportsthread_id_unknowninstead of a thread. - room-threads: List thread roots in a room with pagination support via
page_token. - thread-list: List messages in a thread and include edit options keyed by event ID.
It uses the current thread when one is active, otherwise you must pass
thread_id. - edit: Edit a previously sent message identified by
target. The requiredtargetselects the event; current thread context does not select or validate the edit target. - context: Return room, thread, reply target, requester, and agent metadata so you can plan a later tool call.
Thread targeting
sendis room-level by default even if the current conversation is inside a thread.sendonly creates a new attachment thread when its effective thread target is room-level. If you pass an explicitthread_id, both text and attachments stay in that existing thread.thread_mode: roomdisables implicit attachment auto-threading for room-level sends. Pass an explicitthread_idwhen you intentionally want threaded output from the tool.replyandthread-replyinherit the current thread when possible.readandcontextalso inherit the current thread when possible.thread_id="room"is a sentinel meaning "force room-level scope and do not inherit the current thread." Use it when you want the room timeline instead of the active thread.
Mention handling with ignore_mentions
- This flag only affects text sends for
send,reply, andthread-reply. - Default
True: the tool writescom.mindroom.skip_mentions=Trueinto the outgoing event content. The bot runtime checks that flag and suppresses mention-triggered agent dispatch, so visible mentions do not page agents. False: the tool does not set the skip flag, so normal mention handling stays active. When the requester is a human rather than the sending bot, the tool also writescom.mindroom.original_sender=<human requester id>, not the bot ID. Downstream authorization and reply-permission checks then treat the event as coming from the original human requester.- self-trigger: an agent can mention itself with
ignore_mentions=Falseto intentionally create a new turn. Use the same pattern for deliberate cross-agent handoffs when another agent should actually wake up and respond.
Safety
- The default
ignore_mentions=Trueexists to prevent accidental infinite loops and noisy mutual paging between agents. - Set
ignore_mentions=Falseonly for intentional dispatch. Prefer one deliberate handoff message over repeated self-mentions or agent-to-agent pings. - Direct
send,reply,thread-reply, andeditcalls reject interactive prompt blocks; use normal agent response delivery for interactive prompts. - Calls are limited to 12 weighted actions per 30 seconds for each agent, requester, and room combination.
Each call costs one action, and each attachment on
send,reply, orthread-replycosts one additional action.
Attachments
- Attachments are only supported for
send,reply, andthread-reply. attachment_idsare context-scopedatt_*IDs.attachment_file_pathsare local file paths that will be registered into the current attachment context before sending. Relative paths resolve from the agent workspace, the same root used asHOMEin worker-routed tools.- The combined limit of
attachment_idsplusattachment_file_pathsis 5 per call. - A send or reply call may include text, attachments, or both, but not neither.
Message extras
message_extrasadds collapsible MindRoom sections to send, reply, thread-reply, and edit events.message_extrasrequires a non-emptymessage; attachment-only sends with extras are rejected.- Keep the visible
messagebrief; put supporting evidence in extras. - Each section has
title,content, optionalcontent_type, and optionalcollapsed. - At most 8 sections are accepted; each title must be non-empty and at most 120 characters, and each content value may contain at most 16,384 characters.
collapsedmust be a boolean and defaults totrue.- Supported
content_typevalues aretext/plain,text/markdown, andtext/html; default istext/markdown. - HTML content may use sanitized rich fragments: paragraphs, headings, lists, tables, blockquotes, code/pre blocks, basic inline formatting, and links.
Do not include scripts, styles, images, forms, media, SVG/math, or interactive elements; links should use
http,https, ormailto. - Example:
message_extras=[{"title": "Evidence", "content_type": "text/html", "content": "<table><tr><td>42</td></tr></table>", "collapsed": true}].
Arguments
action(str): Supported actions aresend,reply,thread-reply,react,read,room-threads,thread-list,edit, andcontext; they send text or attachments, react to an event, read messages, list room thread roots or thread messages, edit a prior event, or return targeting metadata.message(str | None): Text body forsend,reply,thread-reply, andedit; reaction emoji forreactwith a thumbs-up default when empty; useNoneforread,room-threads,thread-list, andcontext.attachment_ids(list[str] | None): Context-scopedatt_*attachment IDs; only valid forsend,reply, andthread-reply, and the combined total withattachment_file_pathscannot exceed 5.attachment_file_paths(list[str] | None): Local file paths to register and send in the current context; relative paths resolve from the agent workspace. It is only valid forsend,reply, andthread-reply, and the combined total withattachment_idscannot exceed 5.room_id(str | None): Optional target room ID or alias; defaults to the current room context when omitted.target(str | None): Event ID to react to forreactor to edit foredit.thread_id(str | None): Optional explicit thread target;thread_id="room"forces room-level scope instead of inheriting the current thread.ignore_mentions(bool): Text-send safety flag forsend,reply, andthread-reply; defaultTruewritescom.mindroom.skip_mentions=Trueto suppress mention-triggered agent dispatch, whileFalsekeeps mentions active and also writescom.mindroom.original_sender=<human requester id>when the requester is not the sending bot.message_extras(list[dict[str, object]] | None): Optional collapsible MindRoom sections for supporting evidence. Each section supports title, content, content_type (text/plain,text/markdown, or sanitizedtext/html), and collapsed.limit(int | None): Maximum messages returned forreadorthread-list, or thread roots returned forroom-threads; values are clamped to 1-50 and default to 20 when omitted.page_token(str | None): Pagination token forroom-threads, returned by a previousroom-threadscall to fetch the next page of thread roots.