Skip to content

SepineTam/mcp-for-stata / plugins/stata-toolbox/skills/stata-skill

stata-skill

Flagged

A packaged Stata Runner skill via official MCP-for-Stata server including stata_do, ado_package_install, help, read_log and get_data_info tools. Use it when (1) need to execute Stata do-file; (2) missing ado-packages; (3) find code error caused by syntax in Stata; (4) want to read smcl and text format log file with rich text output; (5) first encounter a data file and want to understand its structure and content.

references/help.md

View on GitHub
# `help`

Retrieve documentation and usage information for a Stata command.

## Parameters

| Parameter | Type | Required | Default | Description |
|:---|:---|:---|:---|:---|
| `cmd` | `str` | Yes | — | Stata command name (e.g., "regress", "describe", "xtset") |
| `replace` | `bool` | No | `false` | Force refresh of cached help text |

## Returns

String containing Stata help text. If the result is from cache, the prefix shows:

```
Cached result for regress
...help text...
```

Project-cache results use the prefix `Saved result for {cmd}`.

## When to Use

- Understanding a command's syntax, options, or available subcommands
- Troubleshooting errors before running the command
- Verifying correct option names and their effects

## Platform Limitation

**Unix only (macOS / Linux).** This tool is automatically filtered out on Windows during tool registration. On Windows, users should consult the Stata manual or online documentation.

## Caching

Help text is cached at two levels:

1. **Project cache**: stored at `<WORKING_DIR>/.statamcp/stata-mcp-tmp/help__{cmd}.txt`
2. **Global cache**: stored at `~/.statamcp/help/help__{cmd}.txt`

Only enabled cache locations are considered. If both contain a non-empty result,
the newest file by modification time is returned. If their timestamps match, the
project cache is preferred.

Caching is controlled by environment variables:

| Variable | Default | Description |
|:---|:---|:---|
| `STATA_MCP__CACHE_HELP` | `true` | Enable the global help cache |
| `STATA_MCP__SAVE_HELP` | `true` | Enable the project help cache |

If cached content seems stale or incorrect, pass `replace=true`. This bypasses
cache lookup, queries Stata, and overwrites both project and global cache files.

## Example

```python
# Look up regress command documentation
help(cmd="regress")

# Force refresh cache
help(cmd="xtreg", replace=true)
```

## Notes

- There is no automatic TTL-based refresh; use `replace=true` after an external package update
- Successful package installation attempts to refresh help for the likely command name, but packages may provide commands with different names
- `cmd` must be a single Stata command name that starts with a letter or underscore and otherwise contains only letters, numbers, and underscores
- Help text retrieval uses the Stata CLI's `help` command internally
- If the command does not exist, Stata returns an error message in the help text
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall