fetch_plot
Retrieve the PNG bytes of a plot previously generated in this session. Use when the inline image is corrupted or you need the bytes for downstream steps.
Instructions
Re-fetch the PNG bytes of a plot previously generated IN THIS SESSION.
WHEN TO USE THIS TOOL: Call this when you need the canonical PNG bytes for a plot that's already been generated. Common cases:
The inline image in the original plot tool response was corrupted or didn't render in the client.
You need the bytes for a downstream step (e.g. embedding in a transcript, saving to a side file, base64-encoding for an external API).
The user asked to see the plot again without re-running the analysis.
WHAT THIS TOOL DOES NOT DO: It does NOT re-render the plot. It returns the same bytes that were registered when the plot was originally generated. If the underlying data has changed, re-run the plot tool itself (create_volcano_plot, create_venn_diagram); don't expect fetch_plot to pick up new data.
EQUIVALENT RESOURCE URI:
This tool returns the same bytes that resources/read would return
for plot://<session_id>/<filename>. Use whichever path your client
supports better — resources for clients that render them well, this
tool for clients that don't.
REGISTRY BOUNDS: Each session holds its last 8 plots (FIFO eviction). Older plots, and plots from other or expired sessions, return a clear "not in registry" error and need to be regenerated by re-running the source plot tool under the current session.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | Suggested filename of a previously generated plot (e.g. 'venn_expression_2way_OSD-244.png'). Look at the most recent create_volcano_plot or create_venn_diagram response — the filename appears in the 'Save' block. Each session keeps its last 8 plots in memory. | |
| session_id | No | Session id returned by `create_session()`. This server serves many users from one process; the session id is what keeps your output directory and generated plots private to you. Pass the SAME value on every tool call. If the server replies that the session is unknown or expired, call `create_session()` again and use the new id. |