refactor: Enforce strict typed JsonSchema for all MCP tools
This commit is contained in:
1 parent
686fea683d
commit
2d3aaed289
31 files changed
+2892
-308
No files matched your search
+25
@@ -0,0 +1,25 @@
|
||||
import sys
|
||||
|
||||
handlers_path = r"C:\Users\reazul.ashraf\workspace\rust\mcp-memory\server\src\handlers.rs"
|
||||
with open(handlers_path, "r", encoding="utf-8") as f:
|
||||
content = f.read()
|
||||
|
||||
content = content.replace(
|
||||
'return Some(crate::mcp::success(id.clone(), serde_json::json!({"isError": true, "content": [{"type": "text", "text": format!("Invalid args: {}", e)}] })));',
|
||||
'return Some(crate::mcp::success(id.clone(), serde_json::json!({"isError": true, "content": [{"type": "text", "text": format!("Invalid args: {}", e)}] })))'
|
||||
)
|
||||
content = content.replace('let graph = self.state.graph.read();', 'let graph = self.state.get_full_graph();')
|
||||
|
||||
with open(handlers_path, "w", encoding="utf-8") as f:
|
||||
f.write(content)
|
||||
print("Fixed handlers.rs again")
|
||||
|
||||
main_path = r"C:\Users\reazul.ashraf\workspace\rust\mcp-memory\server\src\main.rs"
|
||||
with open(main_path, "r", encoding="utf-8") as f:
|
||||
main_content = f.read()
|
||||
|
||||
main_content = main_content.replace('state_git.code_changes.modify(|changes| {', 'state_git.ledger.modify(|changes| {')
|
||||
|
||||
with open(main_path, "w", encoding="utf-8") as f:
|
||||
f.write(main_content)
|
||||
print("Fixed main.rs again")
|
||||
Reference in new issue
Block a user