What
Add a visualize MCP tool that takes a variable name (or expression) from the current session and generates an appropriate UnicodePlots visualization based on the data type.
Why
Right now, plotting requires the user to know UnicodePlots API, import it, and write the right incantation. A visualize tool would let Claude (or the user) just say "visualize x" and get the right plot automatically.
How it would work
visualize(variable="x") # auto-detect: vector → lineplot, matrix → heatmap
visualize(variable="df.age") # column from a DataFrame → histogram
visualize(variable="loss_history", type="line") # explicit type override
Type detection logic:
Vector{<:Real} → lineplot (index vs value) or histogram (if looks like samples)
Matrix{<:Real} → heatmap
- Two vectors of same length →
scatterplot
- Named tuple / Dict of numbers →
barplot
- DataFrame column →
histogram
The tool would:
- Check if UnicodePlots is loaded on the worker, offer to install if not
- Inspect the variable's type and size via
get_worker_info patterns
- Generate and execute the appropriate plot code
- Return the rendered plot with ANSI colors
Scope
- New file:
src/visualize.jl
- New tool registration in
src/tools.jl
- Add to plugin skills
- Tests for type detection logic
What
Add a
visualizeMCP tool that takes a variable name (or expression) from the current session and generates an appropriate UnicodePlots visualization based on the data type.Why
Right now, plotting requires the user to know UnicodePlots API, import it, and write the right incantation. A
visualizetool would let Claude (or the user) just say "visualize x" and get the right plot automatically.How it would work
Type detection logic:
Vector{<:Real}→lineplot(index vs value) orhistogram(if looks like samples)Matrix{<:Real}→heatmapscatterplotbarplothistogramThe tool would:
get_worker_infopatternsScope
src/visualize.jlsrc/tools.jl