Lint Stata code before running it
stata_lintChecks Stata code for silent logic errors that run without error but produce wrong results, flagging first-observation if, unsorted _n, and undeclared locals; errors block, warnings do not.
Instructions
Check Stata code for constructs that run without an error yet do the wrong thing: the if command (first observation only), _n without a sort, gen on an existing variable, undeclared locals, missing(a b c) as a varlist, variable abbreviation left on. Pass code or file. Errors block, warnings do not: the caller decides.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "stata_lint"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory used to resolve `do "other.do"` references. | |
| code | No | Stata code to review. | |
| file | No | Path to a .do file to review instead of `code`. |