plot_from_result
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
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | Override the auto-detected plot kind. Common values: 'event_study', 'rdplot', 'synth_gap', 'love_plot', 'coef_plot'. | |
| detail | No | Payload 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 |
| figsize | No | Width, height in inches (default [8,5]). | |
| as_handle | No | If 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_path | No | Absolute 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_id | Yes | Handle to a fitted result. | |
| data_columns | No | Optional column projection. Parquet/Feather/Stata loaders honour this for fast partial reads. | |
| data_sample_n | No | Optional uniform random subsample size (seed=0, deterministic) — useful on huge panels. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||