Skip to main content
Glama

Stata-MCP

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Schema

Prompts

Interactive templates invoked by user choice

NameDescription
stata_assistant_role Return the Stata assistant role prompt content. This function retrieves a predefined prompt that defines the role and capabilities of a Stata analysis assistant. The prompt helps set expectations and context for the assistant's behavior when handling Stata-related tasks. Args: lang (str, optional): Language code for localization of the prompt content. If None, returns the default language version. Defaults to None. Examples: "en" for English, "cn" for Chinese. Returns: str: The Stata assistant role prompt text in the requested language. Examples: >>> stata_assistant_role() # Returns default language version "I am a Stata analysis assistant..." >>> stata_assistant_role(lang="en") # Returns English version "I am a Stata analysis assistant..." >>> stata_assistant_role(lang="cn") # Returns Chinese version "我是一个Stata分析助手..."
stata_analysis_strategy Return the Stata analysis strategy prompt content. This function retrieves a predefined prompt that outlines the recommended strategy for conducting data analysis using Stata. The prompt includes guidelines for data preparation, code generation, results management, reporting, and troubleshooting. Args: lang (str, optional): Language code for localization of the prompt content. If None, returns the default language version. Defaults to None. Examples: "en" for English, "cn" for Chinese. Returns: str: The Stata analysis strategy prompt text in the requested language. Examples: >>> stata_analysis_strategy() # Returns default language version "When conducting data analysis using Stata..." >>> stata_analysis_strategy(lang="en") # Returns English version "When conducting data analysis using Stata..." >>> stata_analysis_strategy(lang="cn") # Returns Chinese version "使用Stata进行数据分析时,请遵循以下策略..."
helpGet help for a Stata command
results_doc_path Generate and return a result document storage path based on the current timestamp. This function performs the following operations: 1. Gets the current system time and formats it as a '%Y%m%d%H%M%S' timestamp string 2. Concatenates this timestamp string with the preset result_doc_path base path to form a complete path 3. Creates the directory corresponding to that path (no error if directory already exists) 4. Returns the complete path string of the newly created directory Returns: str: The complete path of the newly created result document directory, formatted as: `<result_doc_path>/<YYYYMMDDHHMMSS>`, where the timestamp portion is generated from the system time when the function is executed Notes: (The following content is not needed for LLM to understand) - Using the `exist_ok=True` parameter, no exception will be raised when the target directory already exists - The function uses the walrus operator (:=) in Python 3.8+ to assign a variable within an expression - The returned path is suitable for use as the output directory for Stata commands such as `outreg2` - In specific Stata code, you can set the file output path at the beginning.

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Tools

Functions exposed to the LLM to take actions

NameDescription
read_log
Read the log file and return its content. Args: log_path (str): The path to the log file. Returns: str: The content of the log file.
get_data_info

Get descriptive statistics for the data file

write_dofile

write the stata-code to dofile

append_dofile

append stata-code to an existing dofile or create a new one

stata_do

Run a stata-code via Stata

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/stata-mcp'

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