Skip to main content
Glama
stata-copilot

stata-copilot

by Parado-D

Run Stata code

stata_run

Execute Stata commands in a live session and return structured success, output, graphs, and warnings. Set cwd for relative paths or increase timeout for bootstrap and simulation loops.

Instructions

Execute a block of Stata commands in the live session and return structured results: success, return code, output transcript (truncated), generated graphs, and policy warnings. Set cwd when the code uses relative paths, and raise timeout for bootstrap/simulation loops.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>"
    },
    "name": "stata_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdNoWorking directory applied before the code runs (absolute path).
codeYesStata commands, newline separated, as they would appear in a do-file.
modeNoTighten the policy for this call (can only be stricter than the session mode).
verifyNoFingerprint the data before and after (datasignature) and report whether it changed.
timeoutNoSeconds before Stata is interrupted (1-600, default 120).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.1

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full load and does it reasonably well: it discloses the return fields (success, return code, output transcript, graphs, policy warnings) and warns that the transcript is truncated. It also reveals that `mode` can only tighten policy and that `verify` fingerprints data before/after, though it never states that this executes arbitrary user code with side effects or what permissions are required.

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

Conciseness5/5

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

Two sentences, front-loaded with the action and the return contract, followed by targeted parameter advice. No filler and no repetition of schema fields verbatim.

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?

There is no output schema, so the description appropriately lists what comes back, and all five parameters are documented in the schema. The main gap is the absence of any warning about side effects or destructive potential when running arbitrary code in a live session, which matters for a tool with no annotations.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds genuine meaning beyond the schema by explaining the intent behind `cwd` (relative-path code) and `timeout` (long simulation loops). The enum `mode` and `verify` are left to the schema, which is acceptable given full coverage.

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 gives a specific verb and resource ("Execute a block of Stata commands in the live session") and enumerates the return payload, so the agent knows exactly what the call produces. It does not explicitly distinguish itself from siblings such as stata_run_do or stata_job_submit, which would be the remaining step for a 5.

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?

Usage context is implied through parameter advice ("Set `cwd` when the code uses relative paths, and raise `timeout` for bootstrap/simulation loops"), which tells the agent when certain arguments matter. There is no explicit statement of when to use this tool versus the do-file runner or job submission siblings, and no exclusions.

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