Skip to main content
Glama
Fervoyush

Plotnine MCP Server

by Fervoyush

list_plot_templates

Browse available preset configurations for common visualization patterns like time series, scatter plots with trends, and distribution comparisons to accelerate plot creation.

Instructions

List all available plot templates with descriptions. Templates provide preset configurations for common visualization patterns like time series, scatter with trend, distribution comparison, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'list_plot_templates' tool. It calls get_template_list() to retrieve templates and formats them into a markdown-style message returned as TextContent.
    async def list_plot_templates_handler() -> list[TextContent]:
        """Handle list_plot_templates tool calls."""
        templates = get_template_list()
    
        message = "Available Plot Templates\n" + "=" * 60 + "\n\n"
    
        for name, description in sorted(templates.items()):
            message += f"• {name}\n  {description}\n\n"
    
        message += "\n" + "=" * 60 + "\n"
        message += "Usage:\n"
        message += "Use 'create_plot_from_template' with the template name,\n"
        message += "data source, and required aesthetics.\n\n"
        message += "Use 'suggest_plot_templates' to get recommendations\n"
        message += "based on your data characteristics."
    
        return [TextContent(type="text", text=message)]
  • Tool registration in the list_tools() handler, including name, description, and empty input schema (no parameters required).
    Tool(
        name="list_plot_templates",
        description="List all available plot templates with descriptions. Templates provide preset configurations for common visualization patterns like time series, scatter with trend, distribution comparison, etc.",
        inputSchema={
            "type": "object",
            "properties": {},
        },
    ),
  • Helper function imported as get_template_list() that extracts and returns the dictionary of all template names and their descriptions from the TEMPLATES data structure.
    def list_templates() -> dict[str, str]:
        """
        List all available templates with descriptions.
    
        Returns:
            Dictionary mapping template names to descriptions
        """
        return {name: info["description"] for name, info in TEMPLATES.items()}
  • Central data structure defining all available plot templates, including names, descriptions, configurations, and required aesthetics. This is the source data used by list_templates().
    TEMPLATES = {
        "time_series": {
            "description": "Line plot optimized for time-based data with date formatting",
            "config": {
                "geoms": [{"type": "line", "params": {"size": 1}}],
                "scales": [{"aesthetic": "x", "type": "datetime", "params": {}}],
                "theme": {
                    "base": "minimal",
                    "customizations": {"figure_size": [12, 6]},
                },
            },
            "required_aesthetics": ["x", "y"],
            "suggested_aesthetics": ["color", "group"],
        },
        "scatter_with_trend": {
            "description": "Scatter plot with linear regression trend line and confidence interval",
            "config": {
                "geoms": [
                    {"type": "point", "params": {"size": 2, "alpha": 0.6}},
                    {"type": "smooth", "params": {"method": "lm", "se": True}},
                ],
                "theme": {"base": "minimal"},
            },
            "required_aesthetics": ["x", "y"],
            "suggested_aesthetics": ["color"],
        },
        "distribution_comparison": {
            "description": "Violin plot for comparing distributions across groups",
            "config": {
                "geoms": [
                    {"type": "violin", "params": {"alpha": 0.7}},
                    {"type": "jitter", "params": {"width": 0.1, "alpha": 0.3, "size": 1}},
                ],
                "theme": {"base": "bw"},
            },
            "required_aesthetics": ["x", "y"],
            "suggested_aesthetics": ["fill", "color"],
        },
        "category_breakdown": {
            "description": "Bar chart showing counts or values by category",
            "config": {
                "geoms": [{"type": "col", "params": {}}],
                "theme": {
                    "base": "minimal",
                    "customizations": {"legend_position": "bottom"},
                },
                "coords": {"type": "flip", "params": {}},
            },
            "required_aesthetics": ["x", "y"],
            "suggested_aesthetics": ["fill"],
        },
        "correlation_heatmap": {
            "description": "Heatmap for visualizing correlations or relationships",
            "config": {
                "geoms": [{"type": "tile", "params": {}}],
                "scales": [
                    {
                        "aesthetic": "fill",
                        "type": "gradient",
                        "params": {"low": "blue", "high": "red"},
                    }
                ],
                "theme": {
                    "base": "minimal",
                    "customizations": {"figure_size": [10, 8]},
                },
            },
            "required_aesthetics": ["x", "y", "fill"],
            "suggested_aesthetics": [],
        },
        "boxplot_comparison": {
            "description": "Boxplot with individual points for detailed distribution comparison",
            "config": {
                "geoms": [
                    {"type": "boxplot", "params": {"alpha": 0.7}},
                    {"type": "jitter", "params": {"width": 0.2, "alpha": 0.4, "size": 1}},
                ],
                "theme": {"base": "bw"},
            },
            "required_aesthetics": ["x", "y"],
            "suggested_aesthetics": ["fill", "color"],
        },
        "multi_line": {
            "description": "Multiple line plots for comparing trends across categories",
            "config": {
                "geoms": [{"type": "line", "params": {"size": 1.2}}],
                "theme": {
                    "base": "minimal",
                    "customizations": {
                        "figure_size": [12, 6],
                        "legend_position": "right",
                    },
                },
            },
            "required_aesthetics": ["x", "y", "color"],
            "suggested_aesthetics": ["linetype"],
        },
        "histogram_with_density": {
            "description": "Histogram overlaid with kernel density curve",
            "config": {
                "geoms": [
                    {"type": "histogram", "params": {"alpha": 0.7, "bins": 30}},
                    {"type": "density", "params": {"alpha": 0}},
                ],
                "theme": {"base": "minimal"},
            },
            "required_aesthetics": ["x"],
            "suggested_aesthetics": ["fill", "color"],
        },
        "before_after": {
            "description": "Side-by-side comparison of before and after measurements",
            "config": {
                "geoms": [
                    {"type": "point", "params": {"size": 3}},
                    {"type": "line", "params": {"alpha": 0.5}},
                ],
                "theme": {"base": "bw"},
                "facets": {"type": "wrap", "params": {"ncol": 2}},
            },
            "required_aesthetics": ["x", "y"],
            "suggested_aesthetics": ["group", "color"],
        },
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions that templates include 'descriptions' and examples of patterns, but does not disclose key behavioral traits such as whether the list is paginated, sorted, or filtered, what the return format is, or any rate limits. This leaves significant gaps in understanding how the tool behaves.

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

Conciseness5/5

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

The description is two sentences, front-loaded with the core purpose and followed by additional context on what templates provide. Every sentence adds value by clarifying the resource and its utility, with no wasted words or redundancy.

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 tool's simplicity (0 parameters, no output schema, no annotations), the description is adequate but incomplete. It covers the purpose and some context on template types, but lacks details on behavioral aspects like output format or usage constraints, which are important even for simple tools.

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

Parameters4/5

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

The tool has 0 parameters, and schema description coverage is 100%, so there are no parameters to document. The description does not need to add parameter semantics, and it appropriately avoids discussing parameters, earning a baseline score of 4 for this context.

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 verb 'List' and resource 'all available plot templates with descriptions', specifying what the tool does. It distinguishes from some siblings like 'create_plot' or 'export_plot_config' by focusing on listing rather than creation or export, but does not explicitly differentiate from 'list_color_palettes' or 'list_themes' which are similar list operations.

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 implies usage by mentioning 'Templates provide preset configurations for common visualization patterns', suggesting it's for discovering visualization options. However, it does not explicitly state when to use this tool versus alternatives like 'suggest_plot_templates' or 'list_geom_types', nor provide exclusions or prerequisites for usage.

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/Fervoyush/plotnine-mcp'

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