Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

diagnose_result

Read-only

Auto-selects and runs the appropriate diagnostic battery for your fitted causal model—OLS, DID, RDD, IV, SCM—to surface assumption violations and recommend next actions.

Instructions

Method-aware diagnostic battery: auto-selects tests by model type (OLS/DID/RDD/IV/SCM). Assumptions: The result object carries a recognizable method_type so the correct diagnostic battery can be routed; Each sub-check (e.g. parallel-trends, weak-IV, overid, balance) is only valid under that method's own identifying assumptions; Tests use the supplied alpha as the significance threshold; p-values are interpreted, not corrected for multiplicity. Pre-conditions: A fitted EconometricResults or CausalResult from a StatsPAI estimator; The estimator must expose enough fitted internals (residuals, first-stage, design info) for its checks. Failure modes: Passed a raw DataFrame, dict, or estimate float instead of a fitted result object -> Fit an estimator first and pass the returned result object, not the input data; Method type is unrecognized so no diagnostic battery applies and 'checks' comes back empty -> Run the method-appropriate standalone diagnostic directly instead of the router. Alternatives: sp.unified_sensitivity, sp.sensemakr, sp.oster_bounds, sp.spec_curve. Typical minimum N: 30.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
detailNoPayload depth: 'minimal' (~150 tokens) for sub-step calls where only the point estimate is needed; 'standard' (~1K tokens) for diagnostics + coefficient table; 'agent' (~2K tokens, default) adds violations / next_steps / suggested_functions so the LLM can plan its next call without another round-trip.agent
resultYesFitted result from any StatsPAI estimator
as_handleNoIf true, cache the fitted result on the server and return result_id + result_uri alongside the JSON payload so a subsequent tools/call can chain without re-running.
data_pathNoAbsolute path or URL to a data file. Supported: .csv / .tsv / .txt (delimited), .parquet / .pq, .feather / .arrow, .xlsx / .xls, .dta (Stata), .json / .jsonl. Schemes: file://, s3://, gs://, https://.
result_idNoOptional handle to a previously-fitted result (returned by an earlier call when as_handle=true). Tools that operate on a fitted object accept this in place of re-supplying data_path + columns.
data_columnsNoOptional column projection. Parquet/Feather/Stata loaders honour this for fast partial reads.
data_sample_nNoOptional uniform random subsample size (seed=0, deterministic) — useful on huge panels.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

Annotations only carry readOnlyHint=true and openWorldHint=false. The description goes far beyond this by disclosing the auto-selection logic, the assumption that result carries method_type, the validity condition for sub-checks, the use of alpha as significance threshold, and the fact that p-values are not multiplicity-corrected. It also exposes failure modes, including empty 'checks' for unrecognized methods. This is rich behavioral disclosure with no contradiction.

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 long but well-structured with labeled sections (Assumptions, Pre-conditions, Failure modes, Alternatives, Typical minimum N). The core purpose is front-loaded in the first sentence, and every section adds operational value for a complex router tool. No filler or repetition.

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

Completeness5/5

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

For a complex diagnostic router with 7 parameters, an output schema, and many siblings, the description covers purpose, assumptions, pre-conditions, failure modes, alternatives, and a typical minimum N. The output schema exists, so return values need not be spelled out. The description leaves little an agent would need to ask about.

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

Parameters3/5

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

Schema description coverage is 100%, and the schema already provides detailed descriptions for all seven parameters (e.g., detail payload depths, data_path formats, as_handle caching). The description adds no parameter-specific meaning beyond the schema; it mentions 'supplied alpha' but alpha is not a parameter in the schema. Baseline 3 is appropriate.

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?

The description states a specific purpose: a method-aware diagnostic battery that auto-selects tests by model type (OLS/DID/RDD/IV/SCM). It clearly identifies the resource (fitted result object) and the action (diagnostics), but does not explicitly distinguish itself from sibling tools like diagnose, assumption_audit, or forest_diagnostics, leaving some differentiation to inference.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides concrete context: pre-conditions (fitted estimator with exposed internals), failure modes (raw data or unrecognized method type), and explicit alternatives (unified_sensitivity, sensemakr, oster_bounds, spec_curve). It tells the agent to run a standalone diagnostic when the method type is unrecognized, which is a clear when-not. It doesn't give a crisp positive selection rule beyond being a router, but the guidance is solid.

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

Deploy Server

Other Tools