Skip to main content
Glama
shichengg
by shichengg

stata_run

Run a block of Stata commands in the target GUI session, overwriting the session's latest log and returning the actual output. Switch sessions beforehand with stata_session.

Instructions

在最近的 Stata MCP session 对应 GUI 中将 commands 作为一个完整代码块执行;每次覆盖该 session 的最新运行 text log,并自动返回实际输出。可先用 stata_session(action='set_recent') 切换目标 session。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandsYes要执行的 Stata 命令,多行用换行符分隔

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A3.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full behavioral disclosure burden. It explicitly mentions that the tool overwrites the session's latest run text log and returns actual output, which are important side effects. It does not mention error handling or permission requirements, but the disclosed behavior is clear and adds value beyond the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, with the primary action front-loaded and side effects and session-switching guidance following. It is two sentences with no fluff, and each clause carries information. It is slightly verbose due to phrasing, but overall efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one parameter, no output schema, no annotations), the description covers the essential context: the session to use, the side effect (log overwrite), the return of output, and how to switch sessions. It does not cover error handling, but that is not expected for a simple command executor. It is complete enough for an agent to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds a nuance by describing 'commands' as a 'complete code block', but does not provide additional syntax or format details beyond what the schema already states. It adds minimal semantic value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the primary action: executing 'commands' as a complete code block in the most recent Stata session. It also mentions the side effect of overwriting the session's log and returning output, which adds specificity. However, it does not explicitly differentiate from sibling tools like 'stata_run_dofile', so it lacks explicit sibling distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives a usage hint by mentioning that one can switch the target session using 'stata_session(action='set_recent')', which is helpful context. But it does not explicitly state when to use this tool versus alternatives like 'stata_run_dofile' or when not to use it. The guidance is implied rather than explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.