Skip to main content
Glama

iv

Read-only

Run instrumental-variable regression via 2SLS, LIML, Fuller, or GMM from one formula, with first-stage, weak-IV, and endogeneity diagnostics.

Instructions

Instrumental-variables dispatcher: 2SLS, LIML, Fuller or GMM via method=, with first-stage, weak-IV (effective F) and endogeneity diagnostics. Formula 'y ~ x + (d ~ z1 + z2)'. Validation: certified parity evidence.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "formula": "<formula>"
    },
    "name": "iv"
  }
}

Input Schema

NameRequiredDescriptionDefault
vceNo'robust', 'hc1' or 'cluster <col>'.
detailNoPayload depth; agent is the fullest.agent
methodNo2sls
data_idNoData handle (d_...) from load_data; replaces data_path.
formulaYes'y ~ x + (d ~ z1 + z2)' style.
data_csvNoSmall inline table as CSV text.
as_handleNoCache the fit and return its result_id.
data_pathNoAbsolute path of a data file on the server.
result_idNoHandle of an earlier fit made with as_handle=true.
data_recordsNoSmall inline table as row objects.
max_output_bytesNoResult byte budget (default 262144; 0 = none).

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is covered. The description adds that diagnostics are computed as part of the fit, which is genuine behavioral context, but it omits compute cost, whether fits are cached, and what the trailing phrase 'Validation: certified parity evidence' actually means for the caller.

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

Conciseness4/5

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

Two dense sentences, front-loaded with the tool's identity and estimator set before the formula template. The closing fragment 'Validation: certified parity evidence' is unexplained jargon that does not earn its place.

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?

With an output schema present, 11 well-documented parameters at 91% coverage, and a required formula clearly exemplified, the description supplies enough to invoke the tool correctly. The residual gap is competitive positioning against ivreg and pipeline_iv, not call mechanics.

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 91%, so the schema carries the parameter burden and baseline 3 applies; however the description does add value by showing the exact formula grammar with the endogenous-term parenthesization, which is the one parameter an agent is most likely to get wrong. The method= mention mirrors the enum rather than extending it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a concrete verb+resource (an IV estimator) and enumerates the estimators it dispatches to (2SLS, LIML, Fuller, GMM) plus the diagnostics it returns (first-stage, effective F, endogeneity). What it never does is distinguish itself from the visible siblings ivreg and pipeline_iv, so an agent cannot tell which entry point to pick from the description alone.

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?

Usage is only implied: the enumeration of diagnostics signals 'use this when you want weak-IV and endogeneity reporting', and the formula template 'y ~ x + (d ~ z1 + z2)' shows the required call shape. There is no explicit when-to-use or when-not guidance, and no routing to ivreg/pipeline_iv for the single-equation or pipeline cases.

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