Skip to main content
Glama

run_regression

Read-only

Run OLS linear regression on Excel data. Specify file, sheet, dependent and independent columns to get coefficients, R-squared, residuals, and diagnostics, with optional output to a new sheet or file.

Instructions

Run an OLS linear regression and optionally write results to a sheet/file.

Args: file_path: Input workbook path. sheet_name: Worksheet containing data. y_column: Dependent variable column name. x_columns: List of independent variable column names. header_row: 1-based header row index. output_sheet: Optional sheet name for regression output. output_file: Optional path to write results to a separate file.

Returns: RegressionResult: Contains coefficients, R-squared, residuals and diagnostics.

Notes: - Read-only unless output_file/output_sheet is provided (then mutates workbook/creates file).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
y_columnYes
file_pathYes
x_columnsYes
header_rowNo
sheet_nameYes
output_fileNo
output_sheetNoRegression Output

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
equationNo
f_pvalueNo
p_valuesNo
ss_totalNo
t_valuesNo
interceptNo
r_squaredNo
std_errorsNo
f_statisticNo
predictionsNo
ss_residualNo
coefficientsNo
output_sheetNo
n_observationsNo
adjusted_r_squaredNo
confidence_intervalsNo
Behavior1/5

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

The annotations declare readOnlyHint=true, but the description explicitly states: 'Read-only unless `output_file`/`output_sheet` is provided (then mutates workbook/creates file).' This is a direct contradiction with the annotation, so the score must be 1 per the rubric.

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?

The description is well-structured with Args, Returns, and Notes sections. It is front-loaded with a clear summary sentence, and every line provides useful information without unnecessary elaboration. The Notes section is particularly efficient in conveying the conditional mutation behavior.

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?

The description covers the core purpose, all parameters, return value contents (coefficients, R-squared, residuals, diagnostics), and the key behavioral caveat about read-only vs. mutating. An output schema exists, so return-value depth is not required. However, it omits potential edge cases like existing output_sheet handling or data requirements, so it falls slightly short of a 5.

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 description coverage is 0%, so the description must compensate. The Args section provides a one-line semantic explanation for each of the 7 parameters (e.g., 'header_row: 1-based header row index', 'output_file: Optional path to write results to a separate file'). This adds clear meaning beyond the schema's type/title information, though some parameters like x_columns could use more detail.

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 opens with a specific verb and resource: 'Run an OLS linear regression and optionally write results to a sheet/file.' This clearly distinguishes it from sibling tools like correlation_matrix or run_exponential_smoothing. The Args section further reinforces the exact inputs.

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?

The description implies usage for regression analysis but does not explicitly state when to use this tool versus alternatives, nor does it mention exclusions or prerequisites. It provides no comparison to similar analysis tools among the siblings, leaving the agent to infer the appropriate context.

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

Install Server

Other Tools

Latest Blog Posts

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/mbeps/excel-mcp'

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