Skip to main content
Glama

gm_lag

Run a spatial 2SLS or GMM-IV spatial lag model on cross-sectional data. Get coefficients, standard errors, z/p-values, fit metrics, optional Anselin-Kelejian test, and data preview.

Instructions

Run spreg.GM_Lag (spatial 2SLS / GMM-IV spatial lag model) on a cross-section.

Returns coefficients with SE/z/p, fit metrics, (optional) AK test, and a small data preview.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
shapefile_pathYes
y_colYes
x_colsYes
target_crsNoEPSG:4326
weights_methodNoqueen
distance_thresholdNo
w_lagsNo
lag_qNo
yend_colsNo
q_colsNo
robustNo
hac_bandwidthNo
spat_diagNo
sig2n_kNo
drop_naNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior2/5

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

With no annotations, the description must disclose behavioral traits. It lists output components (coefficients, SE, fit metrics) but omits important details like side effects, performance implications, or assumptions about the input data. The mention of optional AK test is helpful but insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that is concise but lacks structure. For a complex tool with many parameters, a more structured format (e.g., listing key parameters or output details) would be warranted, but the current form sacrifices completeness for brevity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (15 parameters, cross-sectional spatial model) and the absence of schema descriptions, the description is insufficient. It does not explain the input data requirements, how parameters interact, or the full output structure beyond a brief list, despite having an output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 15 parameters with 0% description coverage, yet the tool description provides no explanation for any parameter. Critical parameters like weights_method, distance_threshold, and robust are left entirely unexplained, making selection and invocation difficult.

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 clearly identifies the tool as a spatial lag model (spreg.GM_Lag) and specifies it operates on cross-sectional data. The verb 'Run' and the named model differentiate it from sibling tools like OLS or spatial autocorrelation tests.

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 spatial lag modeling on cross-sections, but provides no explicit guidance on when to use this versus alternatives like ols_with_spatial_diagnostics_safe. No when-not-to-use or prerequisite information is given.

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/mahdin75/gis-mcp'

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