You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
return {"message": "Codebase parsing initiated, this may take some time depending on the size of the codebase. Use the `check_parsing_status` tool to check if the parse has completed."}
53
-
return {"message": "Codebase is already being parsed."}
"message": "Codebase parsing initiated, this may take some time depending on the size of the codebase. Use the `check_parsing_status` tool to check if the parse has completed."
66
+
}
67
+
return {"message": "Codebase is already being parsed.", "status": "error"}
54
68
55
69
56
70
@mcp.tool(name="check_parse_status", description="Check if codebase parsing has completed")
@@ -69,17 +83,18 @@ async def execute_codemod(codemod: Annotated[str, "The python codemod code to ex
69
83
70
84
try:
71
85
awaitstate.parse_task
72
-
# TODO: Implement proper sandboxing for code execution
73
-
context= {
74
-
"codebase": state.parsed_codebase,
75
-
"print": capture_output,
76
-
}
77
-
exec(codemod, context)
86
+
if (state.parsed_codebaseisNone):
87
+
return {"error": "Codebase path is not set."}
88
+
else:
89
+
# TODO: Implement proper sandboxing for code execution
90
+
context= {
91
+
"codebase": state.parsed_codebase,
92
+
"print": capture_output,
93
+
}
94
+
exec(codemod, context)
78
95
79
96
logs="\n".join(state.log_buffer)
80
-
81
-
state.reset()
82
-
return {"message": "Codemod executed and codebase reset.", "logs": logs}
97
+
return {"message": "Codemod executed, view the logs for any output and your source code for any resulting updates.", "logs": logs}
0 commit comments