Skip to main content

resolve_chart_disposition

Function resolve_chart_disposition 

Source
pub fn resolve_chart_disposition(
    inline: bool,
    output_path: Option<&str>,
    format: ChartFormat,
) -> ChartDisposition
Expand description

Decide what the chart tool should do with the rendered bytes based on the caller’s inline and output_path flags plus the already-resolved format.

Semantics (see the chart tool docs):

  • inline=true + no path → InlineOnly (skip disk)
  • inline=true + path → WriteAndInline (both)
  • inline=false/absent + path → WriteOnly
  • inline=false/absent + no path → WriteOnly with auto-generated path under std::env::temp_dir()/hyperdb-charts/

This is the default path most callers take: keeps the MCP transcript small by writing the PNG/SVG to disk and letting the caller Read(path) when they want to display it.