Skip to main content
Glama

stata_do

Execute Stata do-files and return execution logs for regressions and statistical analysis. Optionally retrieve logs when errors occur.

Instructions

Execute a Stata do-file and return the execution log. Accepts a do-file path, runs it via the configured Stata executable, and can optionally read log content only when return-code errors are detected. Use when you need to run Stata commands, perform regression or statistical analysis, or execute a do-file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeoutNo
dofile_pathYes
enable_smclNo
log_file_nameNo
is_replace_logNo
read_log_when_errorNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

With no annotations provided, the description carries the full burden. It mentions the tool executes a do-file and optionally reads log on error, but fails to disclose side effects (e.g., file system changes), required permissions, or behavior on failure. This leaves significant gaps for a mutation-like tool.

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 three sentences and concise, front-loading the main action. However, it could be more structured by linking parameters to their roles, but it is not overly verbose.

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

Completeness2/5

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

Given 6 parameters and an output schema, the description is incomplete. It does not explain most parameters (e.g., timeout, log options) beyond a brief mention of error-triggered log reading. This forces the agent to guess parameter semantics, reducing usability.

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

Parameters1/5

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

Schema description coverage is 0%, yet the description adds no detail for parameters beyond mentioning 'dofile_path'. Parameters like 'timeout', 'enable_smcl', 'log_file_name', 'is_replace_log', and 'read_log_when_error' are completely unexplained, making it hard for an agent to use them correctly.

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

Purpose5/5

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

The description clearly states it executes a Stata do-file and returns the execution log, with a specific verb ('Execute') and resource ('Stata do-file'). It distinguishes itself from siblings like 'read_log' and 'get_data_info' by focusing on running do-files for statistical analysis.

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

Usage Guidelines4/5

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

The description explicitly tells when to use the tool: 'Use when you need to run Stata commands, perform regression or statistical analysis, or execute a do-file.' It does not mention when not to use or alternatives, but the context is clear and helpful for an agent.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SepineTam/mcp-for-stata'

If you have feedback or need assistance with the MCP directory API, please join our Discord server