Skip to main content
Glama

dag-studio-mcp

CI License: Apache 2.0

Model Context Protocol (MCP) server for the DAG Studio causal-inference engine. It lets AI agents construct, analyze, and validate causal directed acyclic graphs (DAGs) using the same engine that powers the DAG Studio canvas.

Built and maintained by Black Swan Causal Labs. Listed in the RWE MCP Registry.

Tools

Tool

What it does

analyze_dag

Backdoor paths, minimal sufficient adjustment sets, identifiability

parse_dagitty

Parse dagitty DSL (raw or R-wrapped) into the structured DAG model

generate_code

R / Python analysis code for a DAG, plus a one-click DAG Studio URL

check_overadjustment

Detect adjustment for mediators, colliders, and descendants of exposure

simulate_data

Simulate data from a DAG under user-specified structural coefficients

compute_bias

Empirical bias of an adjustment strategy against the simulated truth

classify_effect_modification

Classify effect-modifier structure (direct, indirect, proxy, common-cause, pure interaction)

get_canonical_example

Canonical teaching DAGs (confounding, M-bias, frontdoor, and others)

validate_engine

Run the full canonical validation suite and report engine version

Every analytical response carries an engine_version stamp, a concordance attestation, a diagnostics block with severity-coded flags, and citations to the underlying methods literature.

Related MCP server: dagster-mcp

Validation

The engine is validated four ways for coherence: against Pearl (2009) theory, against the reference implementation dagitty (Textor et al. 2016), against DAG Studio's own analytical results, and empirically via compute_bias on simulated data.

  • 35 canonical cases: T01 to T15 (structural identification) and EM01 to EM20 (effect modification), runnable live via validate_engine.

  • A release-gate concordance check runs the engine head-to-head against dagitty (vendored at upstream commit 7a65777) and stamps the attestation surfaced in tool responses.

  • 93 unit and integration tests across the engine bindings, the tool layer, and the auth gate.

Hosted endpoint

The server runs as a Cloudflare Worker (Streamable HTTP):

https://dagstudio-mcp.blackswancausallabs.com/mcp

Access is token-gated during the trial period. Request a token at jdiazdecaro@blackswancausallabs.com. Tokens are accepted either as a bearer header or as a ?token= query parameter (the query form exists for clients whose connector UI cannot set custom headers, such as the Claude.ai web connector).

Claude Code:

claude mcp add --transport http dag-studio \
  https://dagstudio-mcp.blackswancausallabs.com/mcp \
  --header "Authorization: Bearer <your token>"

Claude.ai web: add a custom connector pointed at https://dagstudio-mcp.blackswancausallabs.com/mcp?token=<your token>.

Repository layout

  • dag-engine.js / dag-engine.d.ts: the analytical engine, a pure ESM module with no runtime dependencies

  • src/tools/: one file per tool, each exporting { InputSchema, OutputSchema, descriptor, handler }

  • src/worker/: Cloudflare Worker transport and the token gate (auth.ts)

  • src/index.ts: stdio entry point for local use

  • ci/: release-gate concordance harness against vendored dagitty

  • tests/: unit and integration tests (npm test)

  • MCP_REQUIREMENTS.md: the v1 specification

  • FDA_GUIDANCE_ALIGNMENT.md: mapping of DAG Studio capabilities onto FDA draft RWE guidance protocol elements

The engine is developed alongside the DAG Studio canvas app and the vendored copy here is synced at release time. This repository is self-contained: clone it, npm install, and everything builds and tests without further setup.

Development

npm install
npm test                  # full suite
npm run dev               # stdio server via tsx
npm run worker:typecheck  # worker bundle typecheck
npm run worker:deploy     # deploy (stamps engine_version from git HEAD first)

For interactive inspection: npx @modelcontextprotocol/inspector.

Protocol status

Built on @modelcontextprotocol/sdk (TypeScript). Current against the finalized MCP specification revision 2025-11-25. Migration to the 2026-07-28 revision is planned once stable SDK support ships.

License

Apache License 2.0 (see LICENSE).

Exception: ci/dagitty-src/ contains the dagitty reference engine (GPL-2.0, Textor et al.), vendored at upstream commit 7a65777 solely as a release-time CI fixture for the concordance check. It retains its own license, is excluded from the published npm package, and is not part of the deployed worker bundle.

Available Tools

9 tools
analyze_dagAInspect

Returns identifiability status and minimal adjustment sets given the DAG provided. Specifically: open backdoor paths from exposure to outcome (Pearl 2009 Theorem 3.3.2), the minimal sufficient adjustment sets that block them, and all directed paths.

Accepts either a canonical DAG object or a dagitty_string. Returns a diagnostics block summarizing identifiability, unmeasured confounding, and any flagged issues, plus a static concordance attestation for the engine release.

DAG Studio verifies analyses given a DAG. It does not verify that the DAG correctly encodes domain knowledge or that the variables are measurable in any specific dataset. Outputs are conditional on the encoded structure.

When the DAG is meant to depict a paper's causal model, the encoded structure should reflect the paper's own structural assumptions, including those implicit in its analytical approach (what is adjusted for, what is treated as exposure or outcome, what is decomposed into mediators, what is acknowledged as unmeasured or latent confounding, and what is conditioned on as a collider), rather than an external theoretical framing imported from other literature. If the paper contains no explicit DAG, surface the construct-vs-reproduce ambiguity to the user before treating downstream analysis as a reproduction of the paper.

ParametersJSON Schema
NameRequiredDescriptionDefault
edgesNo
nodesNo
outcomeNo
exposureNo
dagitty_stringNoAlternative input: dagitty('dag { ... }') DSL parsed before analysis.

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations, the description carries full burden and does so thoroughly. It discloses dagitty_string precedence, error fallback behavior, the static concordance attestation, and the epistemic limitation that outputs are 'conditional on the encoded structure.' This goes well beyond a bare action statement, effectively setting expectations for the tool's behavior.

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 longer than typical but uses a clear structure: a direct result sentence, a clarification of accepted inputs, and a contextual paragraph on use with paper DAGs. It front-loads the core purpose, though the final paragraph is fairly lengthy and could be tighter.

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?

The tool is complex and the description covers input modes, precedence, output blocks, attestation, and limitations, which is robust given the lack of an output schema. The absence of per-parameter details is a minor gap, but overall the description provides a complete picture of what the tool does and when to apply it.

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?

The schema covers only dagitty_string (20% coverage), and the description compensates by explaining the two input modes and the precedence rule ('only the dagitty_string is used when present'). However, individual fields like edges, nodes, exposure, and outcome are not explained beyond their names, leaving a significant parameter-semantics gap.

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: 'Returns identifiability status and minimal adjustment sets given the DAG provided,' and enumerates concrete outputs (open backdoor paths, adjustment sets, directed paths). This clearly distinguishes the tool from siblings like check_overadjustment or simulate_data by focusing on causal identification from a DAG.

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 clear when-not guidance: it states the tool 'does not verify that the DAG correctly encodes domain knowledge' and advises surfacing ambiguity when a paper lacks an explicit DAG. However, it never names alternative sibling tools or explicitly says 'use this instead of X', so it falls short of the top score.

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

check_overadjustmentAInspect

Given a DAG and a proposed adjustment set, identify variables whose inclusion biases the estimate. Detects three failure modes: • descendant_of_exposure — variable is caused by the exposure; conditioning on it blocks part of the causal effect being estimated, changing the estimand (Schisterman 2009). • collider — variable is a collider on a non-causal X→Y path whose conditioning opens that path; conditioning is unjustified unless another set member re-blocks it. • descendant_of_collider — variable is downstream of an unconditioned collider; conditioning induces the same M-bias as conditioning on the collider directly (Greenland 2003).

Accepts either a canonical DAG object or a dagitty_string; both forms must be paired with adjustment_set.

Outputs are conditional on the encoded structure. DAG Studio verifies analyses given a DAG; it does not verify the DAG correctly encodes domain knowledge.

ParametersJSON Schema
NameRequiredDescriptionDefault
dagNoCanonical DAG object (nodes + edges + exposure + outcome).
adjustment_setYesArray of node ids proposed for adjustment.
dagitty_stringNoAlternative DAG input: dagitty('dag { ... }') DSL.

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description fully discloses behavior by explaining the causal logic behind each failure mode and the assumption that the DAG encodes the true structure. The note that DAG Studio verifies analyses but not the DAG's domain correctness adds important limitations.

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 well-structured with bullet points, each explaining a distinct failure mode with citations. Every sentence contributes to understanding the tool's behavior or limitations, with no unnecessary filler.

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?

The tool has no output schema, so the description should logically hint at return values. It implies the output is the set of biased variables, but doesn't explicitly state the return format. However, the behavioral depth and input constraints make it largely complete for an agent to use correctly.

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 coverage is 100%, so the baseline is 3. The description adds meaningful context beyond the schema by clarifying that dag and dagitty_string are alternatives and that adjustment_set is the target of evaluation, reinforcing the mutual exclusivity and purpose.

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 states the tool's function: given a DAG and adjustment set, identify variables whose inclusion biases the estimate. It lists three specific failure modes (descendant_of_exposure, collider, descendant_of_collider), which distinguishes it from sibling tools like compute_bias or analyze_dag.

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 clear input requirements: either a canonical DAG object or dagitty_string, both paired with adjustment_set. It does not explicitly mention when not to use this tool or name alternative tools, but the context of evaluating adjustment sets is clear.

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

classify_effect_modificationAInspect

For each modifier annotation on the DAG, classify the effect-modification structure per VanderWeele & Robins (2007) and Weinberg (2007). The five types and their regulatory implications: • direct — modifier is structurally independent of the E-D system; subgroup-specific effects are interpretable as pure modification. • indirect — modifier acts through a mediator; subgroup effects conflate modification with mediation. • common-cause — modifier shares an ancestor with the exposure; subgroup effects are confounded unless the ancestor is also adjusted. • proxy — modifier is unobserved; subgroup analyses rest on a downstream proxy. • pure-interaction — modifier has a direct edge to the outcome; the appropriate estimand is the joint effect, not a subgroup-specific effect (Weinberg 2007).

Outputs are conditional on the encoded structure.

ParametersJSON Schema
NameRequiredDescriptionDefault
dagYesCanonical DAG with modifiers populated.

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations available, the description carries the full burden. It discloses the five classification categories and their meanings, which is valuable behavioral context. However, it does not state what the function actually returns (e.g., a map, list, or report), nor does it mention whether it is read-only, what happens if the DAG lacks modifiers, or any assumptions about the input structure. 'Outputs are conditional on the encoded structure' is vague.

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 begins with a clear one-sentence purpose, followed by a structured bullet list of the five classification types. While it is lengthy, the complexity of the taxonomy justifies the detail. The text is well-organized and front-loaded with the main verb and resource.

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

Completeness3/5

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

The tool has no output schema, so the description should compensate by explaining return values and behavior. It explains the classification types thoroughly but does not describe the output format, how results are per-modifier, or edge cases like DAGs without modifiers. Given the moderate complexity, the description is adequate but not complete.

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?

The schema already describes the 'dag' parameter as 'Canonical DAG with modifiers populated', and coverage is 100%. The description adds context by saying 'For each modifier annotation on the DAG', which clarifies that the input must contain annotations, but this is a minor addition beyond the schema. The description focuses more on output taxonomy than on parameter semantics.

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 states the tool's verb ('classify') and resource ('modifier annotation on the DAG'), and differentiates it from siblings by focusing on effect-modification structure. It specifies the classification framework (VanderWeele & Robins 2007, Weinberg 2007), making the purpose precise and unambiguous.

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 when to use the tool (when you have a DAG with modifier annotations), but it does not explicitly contrast it with sibling tools like analyze_dag or check_overadjustment. There is no 'use this when' or 'for other analyses see X' guidance, so the agent is left to infer the tool's niche.

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

compute_biasAInspect

Numerically demonstrate the bias of a proposed adjustment set. Computes the true total effect analytically from the SEM edge coefficients (sum of products along all directed X→Y paths), then fits two OLS regressions on simulated data: crude (Y ~ X) and adjusted (Y ~ X + Z). Reports each estimate, each bias against the true effect, and the bias reduction |crude_bias| − |adjusted_bias|.

Translates a structural claim ("adjust for {age, smoking}") into a numerical demonstration. Composes check_overadjustment internally — any overadjustment flags emitted there are surfaced in this tool's diagnostics as well, so a single call captures both the numerical bias and the structural reason for it.

Outputs are conditional on the linear Gaussian SEM (see simulate_data for assumptions).

ParametersJSON Schema
NameRequiredDescriptionDefault
nNoSample size. Default 1000, maximum 10000.
dagYes
seedNoDeterministic seed. Default 42.
coefficientsNoOptional edge-keyed coefficient overrides, e.g. {'X->Y': 0.8}. Edges not listed use the default 0.5.
adjustment_setYes

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden. It thoroughly discloses the computation approach (analytic path product, two OLS regressions), the outputs (estimates, biases, bias reduction), the internal dependency on check_overadjustment, and the linear Gaussian SEM assumption. This goes beyond the schema and gives the agent a solid mental model, though exact output format is not specified.

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 well-structured: it leads with the main method, then explains the use case and internal composition, and closes with assumptions. Every sentence carries essential information, and the length is appropriate for the tool's complexity. It avoids redundancy and remains highly scannable.

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 tool with five parameters and no output schema, the description covers the core behavior, the product of the tool (estimates, biases, bias reduction), the link to check_overadjustment, and the underlying model assumptions. It could be more explicit about the exact return structure, but it lists the reported quantities, making it largely complete for an agent to anticipate results.

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 coverage is 60%, and the description adds useful context for adjustment_set (e.g., 'adjust for {age, smoking}') and implicitly for coefficients via 'SEM edge coefficients'. However, it does not clarify the dag parameter beyond its role, leaving a gap for the 40% of parameters not covered by schema or description. This is the expected baseline for 60% coverage.

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 states the tool's purpose: it numerically demonstrates the bias of a proposed adjustment set by computing the true total effect and comparing crude/adjusted OLS estimates. It distinguishes itself from siblings by mentioning the internal composition of check_overadjustment and focusing on bias quantification.

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 clear context for when to use the tool (to translate a structural adjustment claim into a numerical demonstration) and highlights that it also surfaces overadjustment flags from check_overadjustment, combining both structural and numerical insights. However, it does not explicitly name alternatives or say when not to use it.

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

generate_codeAInspect

Emit idiomatic Python (networkx.DiGraph) or R (dagitty DSL) source representing the DAG. The identifier_map lets agents trace canvas labels to sanitized code identifiers when these differ (e.g., when labels contain spaces or special characters that aren't valid Python/R identifiers). Useful for handing the DAG to a downstream analysis pipeline. Also returns dagstudio_url — a one-click deep-link that opens the same DAG on the DAG Studio canvas at dagstudio.blackswancausallabs.com. Surface this URL to the user alongside the generated code so they can paste-free open the DAG visually, regardless of which language was requested.

If the DAG depicts a paper's causal model, whether the paper presents a DAG explicitly or only implies one through its analytical approach, the emitted code should reflect that paper's structural assumptions. Do not let the choice of downstream language (Python or R analysis pipeline) become an opportunity to substitute external theoretical commitments for what the paper actually claims as its estimand.

ParametersJSON Schema
NameRequiredDescriptionDefault
dagYesCanonical DAG object.
languageYes

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses that the tool returns a dagstudio_url, sanitizes identifiers via an identifier_map (though not in schema), and adheres to paper claims. This goes beyond basic behavior but leaves details like error handling unspecified.

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 front-loaded with its main purpose but includes a lengthy second paragraph about paper fidelity that, while relevant, could be more concise. The identifier_map reference adds verbosity without clear payoff.

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

Completeness3/5

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

The tool has two parameters and no output schema, so the description needs to explain return values. It mentions dagstudio_url but does not specify the overall output structure (e.g., whether code and URL are returned together). The identifier_map ambiguity also leaves gaps in understanding how to use the tool.

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

Parameters2/5

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

The schema already provides a description for 'dag' and an enum for 'language', but the description adds little clarity. It introduces an 'identifier_map' that is not part of the input schema, potentially confusing agents about tool usage. With 50% schema coverage, the description does not compensate.

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 states the tool's purpose: 'Emit idiomatic Python (networkx.DiGraph) or R (dagitty DSL) source representing the DAG.' It uses a specific verb and resource, distinguishing it from siblings like parse_dagitty or analyze_dag.

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 clear usage context ('Useful for handing the DAG to a downstream analysis pipeline') and includes a caution about preserving the paper's structural assumptions. However, it does not explicitly mention alternatives or when not to use the tool.

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

get_canonical_exampleAInspect

Return one of the canonical validated DAGs from the engine's test suite by ID (T01–T15 for backdoor / adjustment-set canonical structures, EM01–EM20 for effect-modification structures from VanderWeele-Robins 2007 and Weinberg 2007). Useful for few-shot prompting, regression checks, and teaching. The returned DAG is the same one the engine is validated against, so analyze_dag's output on it will match the listed expected values.

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesTest ID. Main-suite IDs are T01–T15; effect-modification IDs are EM01–EM20.

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the transparency burden and does well by stating the DAG is canonical, validated, and identical to the one used for engine validation, making downstream analyze_dag output predictable. It does not describe error behavior or the exact return format, but as a simple getter it provides meaningful behavioral context beyond just 'returns a DAG.'

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?

Three sentences, each earning its place: the first states what is returned and the ID families, the second gives use cases, and the third explains the useful property of matching validated expected values. No filler or redundancy; information density is high and 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 single-parameter getter with no output schema and no annotations, the description is largely sufficient: it covers scope, ID format, use cases, and the relationship to analyze_dag. It stops short of specifying the exact return representation (e.g., dagitty string vs. JSON object), which is a minor gap for an agent expecting to consume the DAG.

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?

The schema already describes the id parameter with 100% coverage, including the T/EM ranges, so baseline is 3. The description adds semantic depth by explaining that T IDs correspond to backdoor/adjustment-set structures and EM IDs to effect-modification structures from specific references, and by noting the validation relationship with analyze_dag.

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 uses a specific verb ('Return') and clearly identifies the resource ('canonical validated DAGs from the engine's test suite') with explicit ID ranges (T01–T15, EM01–EM20). This distinguishes it from sibling tools like analyze_dag or parse_dagitty, which operate on rather than retrieve canonical examples.

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?

It provides clear usage context: 'few-shot prompting, regression checks, and teaching.' It also notes that returned DAGs are the ones the engine is validated against, implying use for testing analyze_dag against expected values. No explicit exclusions or alternatives are given, but the intended use cases are clear.

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

parse_dagittyAInspect

Parse a dagitty DSL string into the canonical DAG shape used by other DAG Studio tools. Accepts dagitty('dag { ... }'), dagitty("..."), and dagitty::dagitty(...) forms. Bidirected (<->) and undirected (--) edges are skipped — DAG Studio represents only directed edges.

This tool parses notation; it does not validate that the encoded DAG is a correct or complete causal model. That is a domain-knowledge question outside the scope of any graph tool.

When the DAG depicts a paper's causal model, encode the structural assumptions of the study being protocolized, including those that are implicit in the analytical approach (what is adjusted for, what is treated as exposure or outcome, what is decomposed into mediators, what is acknowledged as unmeasured or latent confounding, and what is conditioned on as a collider), rather than only what is formally depicted. Most papers contain no explicit DAG; the structural commitments live in the methods and the choice of estimator. Surface the construct-vs-reproduce ambiguity to the user before constructing the DAG, and do not silently overlay normative or theoretical positions from outside literature onto the paper's stated estimand.

ParametersJSON Schema
NameRequiredDescriptionDefault
dagitty_stringYesA dagitty DSL string, e.g., "dagitty('dag { X [exposure]; Y [outcome]; X -> Y }')".

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so well. It explicitly discloses that bidirected and undirected edges are skipped, and that the tool does not validate causal correctness. This goes beyond basic operation and informs the agent of significant behavioral traits.

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 first paragraph is concise and front-loaded, but the third paragraph becomes a lengthy discourse on causal modeling instructions that is tangential to the tool's parsing function. This weakens overall conciseness; some sentences could be tightened or moved to a different context.

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

Completeness3/5

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

The tool has a single parameter and no output schema. The description indicates the output is 'the canonical DAG shape' but does not detail the return structure or error behavior for invalid syntax. Given the simplicity of the tool, the description is adequate but leaves gaps around edge cases and output details.

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 100%, providing a baseline of 3. The description adds value by enumerating accepted input forms: dagitty('dag { ... }'), dagitty("..."), and dagitty::dagitty(...). This clarifies parameter syntax beyond the schema's single example.

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 states the tool's purpose with a specific verb and resource: 'Parse a dagitty DSL string into the canonical DAG shape used by other DAG Studio tools.' This distinguishes it from sibling tools like analyze_dag or validate_engine, which operate on the parsed DAG.

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 clear context on when to use the tool, noting it accepts various dagitty DSL forms and is a preliminary step for other tools. It also implies limitations ('does not validate') but does not explicitly name alternative tools or exclusion scenarios. This is clear context without formal exclusions.

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

simulate_dataAInspect

Generate synthetic data from a Linear Gaussian Structural Equation Model consistent with the DAG. Root variables are sampled N(0,1); each non-root is a linear combination of its parents (default β = 0.5 per edge, overridable via coefficients) plus N(0, 0.25) noise. Output is deterministic given seed (default 42).

Useful for sensitivity analysis and for demonstrating structural claims (e.g., 'adjustment for {age, smoking} eliminates the confounding shown by these data'). Outputs are consistent with the DAG under the linear Gaussian model only — real datasets generated under unknown processes will not in general match these distributions.

ParametersJSON Schema
NameRequiredDescriptionDefault
nNoSample size. Default 1000, maximum 10000.
dagYes
seedNoDeterministic seed. Default 42.
formatNoOutput format. Default 'json'.
coefficientsNoOptional edge-keyed coefficient overrides, e.g. {'X->Y': 0.8}. Edges not listed use the default 0.5.

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description burdens itself well by disclosing the full generative process: root variables N(0,1), non-roots with β=0.5 and N(0,0.25) noise, and determinism via seed. It also clearly states the limitation that real data won't match the distribution, which is critical context.

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?

Two tightly structured paragraphs: the first explains the model and parameters, the second gives use cases and limitations. No filler; every sentence earns its place and the core purpose 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?

The description covers statistical model, determinism, use cases, and a critical validity limitation, making it quite complete for a simulation tool. However, it does not specify the output shape or the expected DAG input format, which an agent might need to invoke successfully.

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?

The schema covers 80% of parameters, leaving dag without a description. The description compensates by explaining that the DAG defines the structural model and that outputs are consistent with it. It also enriches coefficients and seed semantics beyond the schema.

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 'Generate synthetic data from a Linear Gaussian Structural Equation Model consistent with the DAG,' clearly identifying the verb, output, and model type. This directly distinguishes it from analysis/validation siblings like analyze_dag and check_overadjustment.

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 explicitly states it is useful for sensitivity analysis and demonstrating structural claims, with a concrete example. It also warns that outputs are only valid under the linear Gaussian model, implying when not to use it, though it does not explicitly name alternative tools.

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

validate_engineAInspect

Run the canonical validation suite (T01–T15 backdoor / adjustment-set cases, EM01–EM20 effect-modification structures from VanderWeele-Robins 2007 and Weinberg 2007) against the current engine and return pass/fail per case. Use this when an agent or reviewer wants to verify the engine is trustworthy before relying on analyze_dag, check_overadjustment, or classify_effect_modification.

ParametersJSON Schema
NameRequiredDescriptionDefault
suiteNo'main' runs T01–T15. 'effect_modification' runs EM01–EM20. 'all' runs both. Default: 'all'.

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses that the tool runs specific validation suites (T01–T15, EM01–EM20) and returns pass/fail per case, which is the core behavioral expectation. It does not explicitly state whether it has side effects, but 'run... and return' implies a read-only verification operation.

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 two sentences, front-loaded with the main action and return type, then a clear usage sentence. Every clause provides useful information—case IDs, references, intended use—and no words are wasted.

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 low-complexity tool with one optional parameter and no output schema, the description adequately specifies the return behavior (pass/fail per case) and the suite contents. It also ties the tool into the larger toolset, making the context complete for an AI agent.

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?

The schema covers 100% of the single parameter 'suite' with enum values and descriptions. The tool description adds contextual references to the canonical cases but does not materially enhance parameter semantics beyond what the schema already provides, so the baseline 3 is appropriate.

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 uses a specific verb and resource: 'Run the canonical validation suite... against the current engine and return pass/fail per case.' It clearly identifies what the tool does and distinguishes it from siblings by naming analyze_dag, check_overadjustment, and classify_effect_modification as tools to verify before relying on.

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 explicitly states when to use it: 'Use this when an agent or reviewer wants to verify the engine is trustworthy before relying on...' It names the specific sibling tools as downstream consumers. It does not provide explicit when-not-to-use guidance, but the context is clear enough.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 9 tool updatesv0.1.0
    • First observedanalyze_dag
    • First observedcheck_overadjustment
    • First observedclassify_effect_modification
    • First observedcompute_bias
    • First observedgenerate_code
    • First observedget_canonical_example
    • First observedparse_dagitty
    • First observedsimulate_data
    • First observedvalidate_engine

TDQS

A4.3/5.0
Disambiguation5/5

Each tool has a unique action (parse, analyze, check, get, validate, generate, classify, simulate, compute) targeting distinct aspects of DAG analysis. Even the adjustment-related tools are clearly separated: analyze_dag finds adjustment sets, check_overadjustment validates a proposed set, and compute_bias demonstrates numerical bias.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern using lowercase and underscores. The naming is predictable and uniform, with no mixing of conventions.

Tool Count5/5

With 9 tools, the server is well-scoped for its purpose, covering parsing, analysis, validation, simulation, and code generation without redundancy or bloat. Each tool earns its place in the workflow.

Completeness5/5

The tool set covers the full DAG analysis workflow: input parsing, identifiability and minimal adjustment sets, overadjustment detection, effect modification classification, data simulation, bias computation, code generation, and engine validation. No obvious gaps exist for the intended domain.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    A server providing rigorous causal inference tools through the Model Context Protocol (MCP), offering 42 specialized causal analysis tools that cover modeling, effect estimation, attribution, root cause analysis, counterfactuals, and sensitivity analysis.
    4
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    An MCP server that gives AI agents full visibility and control over your Dagster instance, enabling autonomous monitoring, diagnosis, and remediation of data pipelines.
    17
    13
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    An MCP server that exposes causal inference methods (difference-in-differences, synthetic control, propensity matching, and assumption checks) as callable tools, enabling AI agents to run deterministic statistical analyses instead of computing them inline.
    -

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/Black-Swan-Causal-Labs/dagstudio-mcp'

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