From e426700a918cae56012e53b164dedcf23be07f8e Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 5 Nov 2025 16:07:00 +0000 Subject: [PATCH] Add game_mode to create_memory with default ON - create_memory now shows game-style results by default - game_mode parameter added (default: true) - Both create_memory and create_memory_with_ai now show game results - Users can disable game mode with game_mode: false if needed This ensures game-style display appears regardless of which tool Claude Code chooses. --- src/mcp/base.rs | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/src/mcp/base.rs b/src/mcp/base.rs index ff1ce79..b33df66 100644 --- a/src/mcp/base.rs +++ b/src/mcp/base.rs @@ -98,13 +98,17 @@ impl BaseMCPServer { vec![ json!({ "name": "create_memory", - "description": "⚠️ DEPRECATED: Use create_memory_with_ai instead for game-style results! This is a simple memory creation without interpretation or scoring.", + "description": "Create a new memory entry. Simple version with default score (0.5).", "inputSchema": { "type": "object", "properties": { "content": { "type": "string", - "description": "Content of the memory (plain text only, no formatting)" + "description": "Content of the memory" + }, + "game_mode": { + "type": "boolean", + "description": "Show game-style result (default: true)" } }, "required": ["content"] @@ -314,12 +318,31 @@ impl BaseMCPServer { // 基本ツール実装 fn tool_create_memory(&mut self, arguments: &Value) -> Value { let content = arguments["content"].as_str().unwrap_or(""); + let game_mode = arguments["game_mode"].as_bool().unwrap_or(true); // デフォルトON + match self.memory_manager.create_memory(content) { - Ok(id) => json!({ - "success": true, - "id": id, - "message": "Memory created successfully" - }), + Ok(id) => { + if let Some(memory) = self.memory_manager.get_memory(&id) { + let result = if game_mode { + GameFormatter::format_memory_result(memory) + } else { + format!("Memory created (ID: {})", id) + }; + + json!({ + "success": true, + "id": id, + "game_result": result, + "message": "Memory created successfully" + }) + } else { + json!({ + "success": true, + "id": id, + "message": "Memory created successfully" + }) + } + } Err(e) => json!({ "success": false, "error": e.to_string()