Skip to main content
Glama

parse_dagitty

Parse a dagitty DSL string into the canonical DAG representation for DAG Studio, accepting multiple dagitty call forms and skipping non-directed edges.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dagitty_stringYesA dagitty DSL string, e.g., "dagitty('dag { X [exposure]; Y [outcome]; X -> Y }')".
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.

Install Server

Other Tools

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