Skip to main content
Glama
Fervoyush

Plotnine MCP Server

by Fervoyush

list_themes

Discover available themes for customizing plot styling in Plotnine visualizations, enabling tailored design choices for data graphics.

Instructions

List all available themes for plot styling

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main execution logic for the list_themes tool. Imports THEME_MAP, defines descriptions, constructs a formatted message listing themes and customizations, and returns it as TextContent.
    async def list_themes_handler() -> list[TextContent]:
        """Handle list_themes tool calls."""
        from .plot_builder import THEME_MAP
    
        theme_descriptions = {
            "gray": "Gray background with white gridlines (ggplot2 default)",
            "bw": "Black and white theme with no background",
            "minimal": "Minimalist theme with minimal gridlines",
            "classic": "Classic look with axis lines and no gridlines",
            "dark": "Dark background theme",
            "light": "Light theme with subtle gray background",
            "void": "Empty theme with no elements (for custom designs)",
        }
    
        message = "Available Themes\n" + "=" * 50 + "\n\n"
        message += "Base themes:\n"
        for theme_name in sorted(THEME_MAP.keys()):
            desc = theme_descriptions.get(theme_name, "")
            message += f"  - {theme_name}: {desc}\n"
    
        message += "\n" + "=" * 50 + "\n"
        message += "Customization options:\n"
        message += "  - figure_size: [width, height] in inches\n"
        message += "  - legend_position: 'right', 'left', 'top', 'bottom', 'none'\n"
        message += "  - legend_direction: 'vertical', 'horizontal'\n"
        message += "  - panel_background: background color/style\n"
        message += "  - plot_background: overall plot background\n"
        message += "  - text: global text properties\n"
        message += "  - axis_text: axis label styling\n"
        message += "  - axis_title: axis title styling\n"
    
        message += "\nExample usage:\n"
        message += '  "theme": {\n'
        message += '    "base": "minimal",\n'
        message += '    "customizations": {\n'
        message += '      "figure_size": [12, 6],\n'
        message += '      "legend_position": "bottom"\n'
        message += '    }\n'
        message += '  }\n'
    
        return [TextContent(type="text", text=message)]
  • Registers the list_themes tool in the @server.list_tools() handler with its name, description, and empty input schema (no parameters required).
    Tool(
        name="list_themes",
        description="List all available themes for plot styling",
        inputSchema={
            "type": "object",
            "properties": {},
        },
    ),
  • Defines the input schema for list_themes tool: an empty object (no input parameters needed).
    inputSchema={
        "type": "object",
        "properties": {},
    },
  • Supporting constant THEME_MAP that maps theme names to plotnine theme functions, used by the handler to list available themes.
    THEME_MAP = {
        "gray": theme_gray,
        "grey": theme_gray,
        "bw": theme_bw,
        "minimal": theme_minimal,
        "classic": theme_classic,
        "dark": theme_dark,
        "light": theme_light,
        "void": theme_void,
    }
  • Tool dispatch in @server.call_tool(): routes 'list_themes' calls to the list_themes_handler.
    elif name == "list_themes":
        return await list_themes_handler()
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 states this is a list operation, implying it's likely read-only and non-destructive, but doesn't disclose any behavioral traits such as permissions needed, rate limits, output format, or whether it returns a static or dynamic list. This is a significant gap for a tool with zero annotation coverage.

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 a single, efficient sentence that directly states the tool's purpose without any fluff. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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 minimally adequate. It states what the tool does but lacks context on usage, behavioral traits, or output details. For a list tool, this is the bare minimum, leaving gaps in completeness.

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 input schema has 0 parameters with 100% coverage, so there's no need for parameter documentation in the description. The description appropriately doesn't mention parameters, which aligns with the schema. A baseline of 4 is applied since no parameters exist, and the description doesn't add unnecessary details.

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 themes for plot styling'), making the purpose immediately understandable. However, it doesn't specifically differentiate this from sibling tools like 'list_color_palettes' or 'list_geom_types' beyond the resource type, which keeps it from a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context for usage, or how it relates to sibling tools like 'list_plot_templates' or 'suggest_plot_templates', leaving the agent to infer usage scenarios.

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