stata_run_dofile
Execute a do-file in the Stata GUI, track each run with a session ID, overwrite the session's latest log, and return the log content without altering the original file.
Instructions
在 Stata GUI 中运行一个 do 文件。该工具以 session_id 表示一个复现任务/同一个 Stata GUI;同一任务的原始 do、检查 do、续跑 do 应使用同一个 session_id。每次调用都会覆盖该 session 在项目 .stata-mcp/cache/ 下的最新运行 text log,并自动返回日志内容;不会修改用户原始 do 文件。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | do 文件的完整路径,例如 D:/project/analysis.do | |
| role | No | 该 do 在 session 中的角色:entry/source/auxiliary,默认 entry | |
| log_mode | No | 兼容参数;1.1 版始终使用 replace 覆盖 session 最新运行日志 | |
| session_id | No | 可选;同一复现任务固定使用同一个 session_id。不传时兼容旧行为:用 do 文件路径作为 session key |