Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

das_gupta

Read-only

Decompose the gap between two groups' aggregate metrics into contributing factors with Das Gupta's certified multi-factor method, revealing which drivers explain the difference.

Instructions

Das Gupta (1993) multi-factor decomposition. Validation: certified parity evidence.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
byNoColumn(s) identifying the stratum of each row, used to pair the rows of ``data_a`` and ``data_b``. Both frames must contain the same strata. Without ``by`` the rows are paired by position, which requires equal lengths.
data_aYesOne row per stratum (e.g. age group). The aggregate for each population is ``R = sum_i prod_f factor_{f,i}``; with a single row it is simply ``prod_f factor_f``.
data_bYesOne row per stratum (e.g. age group). The aggregate for each population is ``R = sum_i prod_f factor_{f,i}``; with a single row it is simply ``prod_f factor_f``.
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
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.
factor_namesYesfactor_names parameter (Sequence[str]).
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

C2.5/5.0
Behavior2/5

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

Annotations already cover the safety profile (readOnlyHint=true, openWorldHint=false), and the description does not contradict them. The only added behavioral content is the cryptic 'Validation: certified parity evidence,' which does not explain what is validated, how, or what output to expect. It adds noise rather than useful behavioral disclosure beyond the annotations.

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

Conciseness3/5

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

The description is short and front-loaded with the method name, which is efficient. However, the second fragment 'Validation: certified parity evidence' is a cryptic aside that does not earn its place — it could mislead an agent rather than clarify behavior. This is under-specification dressed as conciseness.

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?

Despite 100% schema coverage and an output schema, the description is too terse for a 10-parameter decomposition tool in a crowded sibling environment. It never explains what the decomposition produces, how factor_names map to the analysis, or how it differs from oaxaca/melly_decompose/kitagawa_decompose. An agent would need deep schema study to invoke it correctly.

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%, so all ten parameters are documented in the schema itself. The description adds no parameter-level meaning beyond what the schema provides, so the baseline of 3 applies; there is no extra value nor any gap to compensate for.

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

Purpose3/5

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

The description names a specific method (Das Gupta 1993) and labels it a 'multi-factor decomposition,' giving a verb+resource. However, it never states what is being decomposed — the schema's data_a/data_b/factor_names imply a two-population factor decomposition, but the description leaves that to inference. Among roughly fifteen decomposition siblings (oaxaca, melly_decompose, kitagawa_decompose, yun_nonlinear, etc.) it differentiates only by the method citation, not by what it computes or how it differs.

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

Usage Guidelines2/5

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

No when-to-use or when-not-to-use guidance is provided, and no alternative decomposition tools are named. An agent must infer from the schema that it compares two populations with factor contributions; nothing in the description helps select this tool over the crowded decomposition sibling set.

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