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.
This commit is contained in:
@@ -98,13 +98,17 @@ impl BaseMCPServer {
|
|||||||
vec![
|
vec![
|
||||||
json!({
|
json!({
|
||||||
"name": "create_memory",
|
"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": {
|
"inputSchema": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"content": {
|
"content": {
|
||||||
"type": "string",
|
"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"]
|
"required": ["content"]
|
||||||
@@ -314,12 +318,31 @@ impl BaseMCPServer {
|
|||||||
// 基本ツール実装
|
// 基本ツール実装
|
||||||
fn tool_create_memory(&mut self, arguments: &Value) -> Value {
|
fn tool_create_memory(&mut self, arguments: &Value) -> Value {
|
||||||
let content = arguments["content"].as_str().unwrap_or("");
|
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) {
|
match self.memory_manager.create_memory(content) {
|
||||||
Ok(id) => json!({
|
Ok(id) => {
|
||||||
"success": true,
|
if let Some(memory) = self.memory_manager.get_memory(&id) {
|
||||||
"id": id,
|
let result = if game_mode {
|
||||||
"message": "Memory created successfully"
|
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!({
|
Err(e) => json!({
|
||||||
"success": false,
|
"success": false,
|
||||||
"error": e.to_string()
|
"error": e.to_string()
|
||||||
|
|||||||
Reference in New Issue
Block a user