summaryrefslogtreecommitdiff
path: root/src/mcp/tools/write_message.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mcp/tools/write_message.c')
-rw-r--r--src/mcp/tools/write_message.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mcp/tools/write_message.c b/src/mcp/tools/write_message.c
index f9c078a..c4b18cc 100644
--- a/src/mcp/tools/write_message.c
+++ b/src/mcp/tools/write_message.c
@@ -185,6 +185,14 @@ call_write_message(const mcpc_tool_t *tool, mcpc_ucbr_t *result)
tiny_search_index_free(context->search_index);
context->search_index = NULL;
}
+ if (context->history_index
+ && !tiny_history_index_add(context->history_index,
+ context->store,
+ tiny_store_entry_count(context->store) - 1))
+ {
+ tiny_history_index_free(context->history_index);
+ context->history_index = NULL;
+ }
tiny_json_init(&json);
tiny_json_raw(&json, "{\"status\":\"OK\",\"message\":");
tiny_mcp_tool_append_message(&json, &written);