Skip to main content
Glama
stata-copilot

stata-copilot

by Parado-D

Start a do-file in the background

stata_job_submit

Submit a .do file as its own background Stata process and get an immediate job ID for long analyses, then poll job status instead of blocking the interactive service.

Instructions

Run a do-file as its own Stata process and return a job id immediately. Use this for analyses that take longer than a couple of minutes: the HTTP service is single-threaded (it answers 409 while busy) and caps each call, while a job has no ceiling and leaves the interactive session free. Poll with stata_job_status.

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": {
      "file": "<file>"
    },
    "name": "stata_job_submit"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdNoWorking directory override (default: the do-file folder).
fileYesAbsolute path to the .do file.
modeNoTighten the policy for this call.
labelNoShort human label shown in stata_job_list.
timeoutNoWall-clock ceiling in seconds before the job is killed (default 1800).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.1

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations present, the description carries the full burden and does well: it discloses asynchronous execution, immediate job-id return, the 409-when-busy behavior of the shared HTTP service, and that jobs are uncapped and free the interactive session. It says nothing about what happens on job failure, log retention, or concurrency limits, leaving some behavioral gaps.

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 dense sentences with the primary action and return value front-loaded, followed by the decision rationale. No filler or redundant restatement of the title.

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?

For a five-parameter tool with no annotations and no output schema, the description adequately covers why and when to use it and what to do next (poll with stata_job_status). It could say more about the mode policy hints and timeout defaults, though the schema already carries those.

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 five parameters (cwd, file, mode, label, timeout) are already documented in structured data, and the description adds no syntax or format detail beyond mentioning the job id. Baseline 3 is appropriate since the schema does the heavy lifting.

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 gives a specific verb and resource ('Run a do-file as its own Stata process') plus the immediate effect ('return a job id immediately'). It implicitly contrasts with the synchronous path by explaining the single-threaded HTTP service and 409 behavior, so an agent can distinguish this from stata_run_do without opening either schema.

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

Usage Guidelines5/5

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

It states an explicit selection threshold ('analyses that take longer than a couple of minutes'), explains why the synchronous route is unsuitable (409 while busy, per-call caps, no ceiling on jobs), and names the follow-up tool (stata_job_status) for polling. The when-to-use and the next step are both spelled out.

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