Skip to main content

Crate mxblocks_tools

Crate mxblocks_tools 

Source
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§

RichCall
A checked call.
ToolSpec
One tool: name, description, input schema.

Constants§

BLOCK_GUIDE
Which blocks to use for what: shared by the tool description and the prompts.
MAX_FALLBACK
Longest fallback, in characters (like say’s text).
MAX_ROOM
Longest room argument.
RICH_EDIT
rich_edit’s name.
RICH_SEND
rich_send’s name.
WEATHER_EXAMPLE
A minimal rich_send example (weather).

Functions§

is_rich_tool
Whether name is 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: what room may 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.