diff options
| author | tanaka takashi <isazaka@gmail.com> | 2026-06-30 19:03:25 +0900 |
|---|---|---|
| committer | tanaka takashi <isazaka@gmail.com> | 2026-06-30 19:03:25 +0900 |
| commit | 05c8e0a31a0d4192c590e833b24393208e1c751f (patch) | |
| tree | f7c2c82c9327abde67bf3acf1d0258573b3bc6c2 /src/mcp/tools/delete_message.c | |
| parent | 4bc721c3bf7589b519c5730d093f704ce56e3f09 (diff) | |
fix: MCPCをvendored fork化しMCP準拠と接続安定性を改善
- Git submoduleを廃止してMCPCを直接管理
- Windowsで254リクエスト付近に発生する切断を修正
- JSON-RPC 2.0エラー応答を標準化
- tool schemaとruntimeの必須・任意引数を一致
- 1000回連続呼び出しの回帰テストを追加
Diffstat (limited to 'src/mcp/tools/delete_message.c')
| -rw-r--r-- | src/mcp/tools/delete_message.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mcp/tools/delete_message.c b/src/mcp/tools/delete_message.c index ae924d7..8b6e8f9 100644 --- a/src/mcp/tools/delete_message.c +++ b/src/mcp/tools/delete_message.c @@ -14,14 +14,15 @@ call_delete_message(const mcpc_tool_t *tool, mcpc_ucbr_t *result) char *message_id = tiny_mcp_tool_get_string(tool, "message_id", TINY_MESSAGE_ID_LENGTH); char *session = tiny_mcp_tool_get_string(tool, "session_id", TINY_SESSION_ID_MAX); tiny_store_status_t status; - if (!context || !message_id || !session || !tiny_message_id_valid(message_id)) + if (!context || !message_id || !tiny_message_id_valid(message_id)) { tiny_mcp_tool_add_error( result, "VALIDATION_ERROR", "message_id must be a canonical 26-character ULID"); } else { - status = tiny_store_delete(context->store, message_id, session[0] ? session : NULL); + status + = tiny_store_delete(context->store, message_id, session && session[0] ? session : NULL); if (status != TINY_STORE_OK && status != TINY_STORE_NOT_FOUND) { tiny_mcp_tool_add_error( @@ -43,8 +44,7 @@ bool tiny_mcp_register_delete_message(mcpc_server_t *server) { mcpc_tool_t *tool = tiny_mcp_tool_new("delete_message", "Delete a message", call_delete_message); - return tool && tiny_mcp_tool_add_property(tool, "message_id", "Message ULID", MCPC_U8STR) - && tiny_mcp_tool_add_property( - tool, "session_id", "Session ID; empty if omitted", MCPC_U8STR) + return tool && tiny_mcp_tool_add_property(tool, "message_id", "Message ULID", MCPC_U8STR, true) + && tiny_mcp_tool_add_property(tool, "session_id", "Optional session ID", MCPC_U8STR, false) && mcpc_server_add_tool(server, tool) == MCPC_EC_0; } |
