Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

pc_algorithm

Read-only

Learn causal structure from observational data using the PC algorithm with conditional independence tests. Outputs a CPDAG and diagnostics to guide next analytical steps.

Instructions

Learn causal structure using the PC algorithm. Validation: validated evidence tier (known-truth, reference, external-parity, or Monte Carlo artifact). Assumptions: Causal Markov condition and faithfulness (PC/GES/FCI); Causal sufficiency for PC/GES (no latent confounders); FCI relaxes this; Acyclicity; LiNGAM additionally assumes a linear non-Gaussian model. Pre-conditions: Constraint-/score-based discovery needs i.i.d. observational data with enough samples for reliable conditional-independence tests; Invariance-based discovery (ICP) needs data labelled by environment / intervention. Failure modes: Unstable skeleton / many undirected edges -- faithfulness or sample size is the likely culprit -> Increase the sample, relax the CI-test threshold, or switch to FCI if latent confounders are plausible. Alternatives: sp.pc_algorithm, sp.fci, sp.ges, sp.lingam. Typical minimum N: 500.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
alphaNoSignificance level for conditional independence tests. Lower alpha = sparser graph (fewer edges).
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
ci_testNoConditional independence test: 'fisherz' (partial correlation) or 'hsic' (kernel-based, non-linear).fisherz
requiredNoBackground knowledge: directed edges ``a -> b`` that must appear in the CPDAG. The skeleton phase preserves them regardless of CI rejection, and the orientation phase pins their direction.
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_pathYesAbsolute 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://.
forbiddenNoBackground knowledge: edges that must NOT appear in the final graph (treated as undirected -- both ``(a, b)`` and ``(b, a)`` are forbidden when either is given). The skeleton phase keeps these absent regardless of CI test outcomes.
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.
variablesNoColumn names to use. If None, uses all numeric 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.
max_cond_sizeNoMaximum conditioning set size. If None, goes up to d-2.

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
Behavior4/5

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

Annotations declare readOnlyHint=true, so the safety profile is already covered. The description adds substantial behavioral context beyond that: assumptions (Causal Markov, faithfulness, sufficiency, acyclicity), failure modes, and a typical minimum N of 500. It does not contradict annotations. It loses one point because it doesn't describe the return payload shape or how the CPDAG output is represented, though the output schema likely covers that.

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?

The description is dense but well-organized with labeled sections (Validation, Assumptions, Pre-conditions, Failure modes, Alternatives, Typical minimum N). Every sentence adds information. It is longer than the ideal one-liner, but the complexity of a causal-discovery tool justifies the length. The most important fact (what the tool does) is front-loaded.

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?

For a 12-parameter causal discovery tool with an output schema, the description covers the key contextual gaps: assumptions, data requirements, failure modes, sample-size guidance, and alternatives. It doesn't explain the output graph representation (CPDAG vs DAG) or how to interpret the result, but the output schema and the 'agent' detail level likely cover that. The description is complete enough for an agent to decide whether to call it and how to react to common failures.

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 the schema already documents all 12 parameters. The description adds context for alpha (via failure-mode advice to relax the CI-test threshold) and for data requirements (i.i.d. vs environment-labelled), but it doesn't systematically map parameters to behavior. Baseline 3 is appropriate when the schema carries the full parameter documentation.

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+resource: 'Learn causal structure using the PC algorithm.' It clearly distinguishes the tool from siblings by naming alternatives (sp.pc_algorithm, sp.fci, sp.ges, sp.lingam) and by stating the algorithm's assumptions. The scope is unambiguous: causal discovery via constraint-based search.

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

Usage Guidelines5/5

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

The description provides explicit pre-conditions (i.i.d. observational data with enough samples for CI tests; environment-labelled data for ICP), failure modes with concrete remedies (increase sample, relax CI threshold, switch to FCI), and names alternatives. This is exactly the when-to-use vs alternatives guidance an agent needs.

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