Skip to main content
Glama
kdqed
by kdqed

strip_plot

Create strip plots from SQL queries on CSV or Parquet data sources to visualize relationships between variables with optional color coding for additional dimensions.

Instructions

Run query against specified source and make a strip plot using result For both csv and parquet sources, use DuckDB SQL syntax Use 'CSV' as the table name in the SQL query for csv sources. Use 'PARQUET' as the table name in the SQL query for parquet sources.

This will return an image of the plot

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
source_idYesThe data source to run the query on
queryYesSQL query to run on the data source
xYesColumn name from SQL result to use for x-axis
yYesColumn name from SQL result to use for y-axis
colorNoOptional column name from SQL result to show multiple colored strips representing another dimension

Implementation Reference

  • The strip_plot tool handler: executes SQL query, generates strip plot with plotly px.strip, converts to PNG image via _fig_to_image, returns ImageContent or error string.
    def strip_plot(self,
        source_id: Annotated[
            str, Field(description='The data source to run the query on')
        ],  
        query: Annotated[
            str, Field(description='SQL query to run on the data source')
        ],
        x: Annotated[
            str, Field(description='Column name from SQL result to use for x-axis')
        ],
        y: Annotated[
            str, Field(description='Column name from SQL result to use for y-axis')
        ],
        color: Annotated[
            str | None, Field(description='Optional column name from SQL result to show multiple colored strips representing another dimension')
        ] = None,
    ) -> str | ImageContent:
        """
        Run query against specified source and make a strip plot using result
        For both csv and parquet sources, use DuckDB SQL syntax
        Use 'CSV' as the table name in the SQL query for csv sources.
        Use 'PARQUET' as the table name in the SQL query for parquet sources.
    
        This will return an image of the plot
        """
    
        try:
            df = self._get_df_from_source(source_id, query)
            fig = px.strip(df, x=x, y=y, color=color)
            fig.update_xaxes(autotickangles=[0, 45, 60, 90])
    
            return _fig_to_image(fig)
        except Exception as e:
            return str(e)
  • Initial registration of strip_plot method in Visualizations.tools list.
    self.tools = [
        self.scatter_plot,
        self.line_plot,
        self.histogram,
        self.strip_plot,
        self.box_plot,
        self.bar_plot,
    
        self.density_heatmap,
        self.polar_scatter,
        self.polar_line,
    ]
  • ZaturnTools aggregates tools from core and visualizations, including strip_plot.
    self.tools = [
        *core.Core(data_sources).tools,
        *visualizations.Visualizations(data_sources).tools,
    ]
  • Final MCP server registration loop adds all tools including strip_plot to FastMCP.
    zaturn_mcp = FastMCP()
    for tool_function in zaturn_tools.tools:
        zaturn_mcp.add_tool(Tool.from_function(tool_function))
  • Helper to convert Plotly figure to base64-encoded ImageContent PNG used by strip_plot.
    def _fig_to_image(fig):
        fig_encoded = b64encode(fig.to_image(format='png')).decode()
        img_b64 = "data:image/png;base64," + fig_encoded
        
        return ImageContent(
            type = 'image',
            data = fig_encoded,
            mimeType = 'image/png',
            annotations = None,
        )
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It reveals that the tool returns an image and mentions SQL syntax requirements, but doesn't disclose important behavioral aspects: whether this is a read-only operation, potential performance implications of running queries, error handling for invalid queries or columns, or any rate limits. For a tool that executes queries and generates visualizations, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with 4 sentences that each serve a purpose: stating the core functionality, specifying SQL syntax requirements, detailing table naming conventions, and describing the return type. It's front-loaded with the main purpose. However, the second and third sentences could potentially be combined for better flow, and some information feels slightly repetitive (mentioning both csv and parquet sources twice).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (query execution + visualization generation), no annotations, and no output schema, the description is moderately complete. It covers the basic workflow and return type (image), but lacks important context: what format the image is in (PNG, JPEG?), typical size/resolution, how errors are handled, whether queries can modify data, or what happens with empty/no result queries. For a tool with this functionality level, more behavioral context would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 5 parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema - it doesn't explain parameter relationships, provide examples of valid queries, or clarify how x/y/color parameters interact with query results. The baseline of 3 is appropriate when the schema does all the parameter documentation work.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Run query against specified source and make a strip plot using result' - this specifies both the action (run query, make strip plot) and resource (specified source). It distinguishes from siblings like 'run_query' (which doesn't create plots) and 'scatter_plot' (which creates a different visualization type). However, it doesn't explicitly contrast with all sibling plot types like 'bar_plot' or 'box_plot' beyond the strip plot specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides implied usage context: it mentions using DuckDB SQL syntax and specific table names for different source types, which suggests when this tool is appropriate (for querying csv/parquet sources). However, it doesn't explicitly state when to choose this tool versus alternatives like 'run_query' (for just querying) or other plot types like 'scatter_plot' or 'histogram'. No explicit exclusions or alternatives are named.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kdqed/zaturn'

If you have feedback or need assistance with the MCP directory API, please join our Discord server