MCPcopy Index your code
hub / github.com/MiniMax-AI/Mini-Agent / execute

Method execute

mini_agent/tools/note_tool.py:91–125  ·  view source on GitHub ↗

Record a session note. Args: content: The information to record category: Category/tag for this note Returns: ToolResult with success status

(self, content: str, category: str = "general")

Source from the content-addressed store, hash-verified

89 self.memory_file.write_text(json.dumps(notes, indent=2, ensure_ascii=False))
90
91 async def execute(self, content: str, category: str = "general") -> ToolResult:
92 """Record a session note.
93
94 Args:
95 content: The information to record
96 category: Category/tag for this note
97
98 Returns:
99 ToolResult with success status
100 """
101 try:
102 # Load existing notes
103 notes = self._load_from_file()
104
105 # Add new note with timestamp
106 note = {
107 "timestamp": datetime.now().isoformat(),
108 "category": category,
109 "content": content,
110 }
111 notes.append(note)
112
113 # Save back to file
114 self._save_to_file(notes)
115
116 return ToolResult(
117 success=True,
118 content=f"Recorded note: {content} (category: {category})",
119 )
120 except Exception as e:
121 return ToolResult(
122 success=False,
123 content="",
124 error=f"Failed to record note: {str(e)}",
125 )
126
127
128class RecallNoteTool(Tool):

Callers 4

test_note_persistenceFunction · 0.95
demo_direct_note_usageFunction · 0.95

Calls 3

_load_from_fileMethod · 0.95
_save_to_fileMethod · 0.95
ToolResultClass · 0.85

Tested by 3

test_note_persistenceFunction · 0.76