Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

plot_from_result

Read-only

Generate diagnostic plots from fitted causal results, auto-selecting the right chart type for each analysis. Returns an inline PNG so you can visually verify model assumptions immediately.

Instructions

Render the canonical diagnostic plot for a fitted result and return it as an inline PNG image content block. MCP clients with vision (Claude Desktop, vision-capable agents) get the plot for free; clients that don't support image content see only the JSON metadata. Plot kind is auto-selected from the result type: event-study for DID, rdplot for RD, gap plot for synth, balance plot for matching, ROC for classification, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindNoOverride the auto-detected plot kind. Common values: 'event_study', 'rdplot', 'synth_gap', 'love_plot', 'coef_plot'.
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
figsizeNoWidth, height in inches (default [8,5]).
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_idYesHandle to a fitted result.
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.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Beyond the readOnlyHint annotation, the description discloses client-dependent behavior (vision clients get the inline PNG; non-vision clients see only JSON metadata) and explains auto-selection. It does not mention the as_handle server-side caching side effect in the main description, but that is documented in the schema. No contradiction with readOnlyHint.

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 dense sentences, front-loaded with the core behavior and return type, followed by client compatibility and auto-selection behavior. No filler or repetition of schema details.

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?

With a rich output schema and 100% schema parameter coverage, the description does not need to restate return formats or parameter details. The only minor gap is that the data loading parameters (data_path, data_columns, data_sample_n) are not mentioned in the description, but their schema descriptions are sufficient.

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 semantics by explaining the auto-detected plot-kind mapping, which clarifies how result_id and kind interact beyond the schema's brief parameter descriptions.

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 states a specific action ('Render the canonical diagnostic plot') on a specific resource ('a fitted result') and specifies the return type ('inline PNG image content block'). It also distinguishes itself from specialized plot siblings by emphasizing auto-selection of the canonical plot from the result type.

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 gives clear context: use this after obtaining a fitted result to get the canonical diagnostic plot, with an explicit mapping of result types to plot kinds. It also advises on behavior for vision-capable vs non-vision MCP clients. However, it does not explicitly name alternative plot tools or state when not to use this tool.

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