Skip to main content
Glama

compute_bias

Demonstrate the bias of a proposed adjustment set by simulating data from a linear SEM, comparing crude and adjusted regression estimates against the true causal effect, and reporting the bias reduction.

Instructions

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).

Input Schema

TableJSON 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
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.

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