Expand description
The rich_send / rich_edit tools for an LLM agent that posts mxblocks
messages: one definition (names, descriptions, input schemas:
tool_specs) and one argument check (plan), for whatever tools
server the agent runs (MCP or a native tool API). Sending is the
caller’s: plan gives the checked payload, text and targets.
Payloads are checked by mxblocks (the v1 catalogue); floats become
decimal strings, since Matrix refuses JSON floats.
§mxblocks-tools
The rich_send / rich_edit tools for an LLM agent that posts
mxblocks messages: names, descriptions and input schemas
(tool_specs), a block-picking guide for prompts (BLOCK_GUIDE,
prompt_line), and the argument check (plan) that turns a call into a
validated payload, its text fallback and its targets (reply, thread, edit,
room). Sending is the caller’s.
let specs = mxblocks_tools::tool_specs("!room:example.org");
assert_eq!(specs.len(), 2);
assert!(mxblocks_tools::is_rich_tool("rich_send"));Apache-2.0.
Structs§
Constants§
- BLOCK_
GUIDE - Which blocks to use for what: shared by the tool description and the prompts.
- MAX_
FALLBACK - Longest
fallback, in characters (likesay’s text). - MAX_
ROOM - Longest
roomargument. - RICH_
EDIT rich_edit’s name.- RICH_
SEND rich_send’s name.- WEATHER_
EXAMPLE - A minimal
rich_sendexample (weather).
Functions§
- is_
rich_ tool - Whether
nameis one of these tools. - plan
- Check a call’s arguments.
- prompt_
line - The prompt line of the tools for a sandboxed context (a served user’s DM, a multi-user room), where they post in this chat.
- tool_
specs - The two tools.
rooms: whatroommay name in this context (shown in its description). - valid_
event_ id - An event id as the tools take it:
$, then 1 to 254 non-space characters.