markdown formatting in messages, sharper tool descriptions

This commit is contained in:
Damocles 2026-05-01 04:20:56 +02:00
parent 829a60854f
commit ef461797ad
4 changed files with 65 additions and 35 deletions

View file

@ -93,7 +93,7 @@ async fn send_message(client: &Client, room_id: &str, body: &str) -> DaemonRespo
let Some(room) = client.get_room(&rid) else {
return DaemonResponse::err(format!("room {rid} not found"));
};
let content = RoomMessageEventContent::text_plain(body);
let content = RoomMessageEventContent::text_markdown(body);
match room.send(content).await {
Ok(_) => {
tracing::info!(room = %rid, "mcp: sent message");
@ -112,7 +112,7 @@ async fn send_dm(client: &Client, user_id: &str, body: &str) -> DaemonResponse {
Ok(r) => r,
Err(e) => return DaemonResponse::err(format!("failed to get/create DM: {e}")),
};
let content = RoomMessageEventContent::text_plain(body);
let content = RoomMessageEventContent::text_markdown(body);
match room.send(content).await {
Ok(_) => {
tracing::info!(user = %uid, "mcp: sent DM");
@ -220,7 +220,7 @@ async fn send_reply(client: &Client, room_id: &str, event_id: &str, body: &str)
return DaemonResponse::err(format!("event {event_id} not found in timeline"));
};
let content = RoomMessageEventContent::text_plain(body).into();
let content = RoomMessageEventContent::text_markdown(body).into();
let reply = Reply {
event_id: full_eid.clone(),
enforce_thread: EnforceThread::MaybeThreaded,