Skip to main content
Glama

Aman-Amith-Shastry-scientific_computation_mcp

plot_function

Read-onlyIdempotent
    Plots a 2D or 3D mathematical function from a symbolic expression string.

    Args:
        expr_str: string representation of a function in x or x and y,
                  e.g. "x**2" or "sin(sqrt(x**2 + y**2))"
        xlim: (xmin, xmax) range for x-axis
        ylim: (ymin, ymax) range for y-axis (used in 2D or 3D)
        grid: resolution of the plot grid

    Returns:
        A rendered Image of the function using Matplotlib.
        - 2D plot if the expression contains only x
        - 3D surface plot if the expression contains both x and y
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gridNoSamples per axis. Higher is smoother and slower.
xlimNox-axis range as (xmin, xmax).
ylimNoy-axis range as (ymin, ymax); used only for 3D surfaces.
expr_strYesFunction of x (2D curve) or of x and y (3D surface), e.g. "x**2" or "sin(x**2 + y**2)".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changed
    • addedInput schema / properties / expr_str / description
      Added value: +"Function of x (2D curve) or of x and y (3D surface), e.g. \"x**2\" or \"sin(x**2 + y**2)\"."
    • addedInput schema / properties / grid / description
      Added value: +"Samples per axis. Higher is smoother and slower."
    • addedInput schema / properties / grid / maximum
      Added value: +1000
    • addedInput schema / properties / grid / minimum
      Added value: +10
    • changedInput schema / properties / grid / title
      Previous value: -"grid"New value: +"Grid"
    • changedInput schema / properties / grid / type
      Previous value: -"string"New value: +"integer"
    • addedInput schema / properties / xlim / description
      Added value: +"x-axis range as (xmin, xmax)."
    • changedInput schema / properties / xlim / prefixItems
      Previous value: -[
      -  {
      -    "type": "integer"
      -  },
      -  {
      -    "type": "integer"
      -  }
      -]New value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "number"
      +  }
      +]
    • addedInput schema / properties / ylim / description
      Added value: +"y-axis range as (ymin, ymax); used only for 3D surfaces."
    • changedInput schema / properties / ylim / prefixItems
      Previous value: -[
      -  {
      -    "type": "integer"
      -  },
      -  {
      -    "type": "integer"
      -  }
      -]New value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "number"
      +  }
      +]
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already mark it readOnly and non-destructive. The description adds useful behavioral detail beyond that: it auto-selects between a 2D line plot and a 3D surface based on whether the expression contains x only or both x and y, and it returns a rendered Matplotlib Image.

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 well-structured with an Args/Returns breakdown, includes concrete expression examples, and front-loads the core purpose. Every sentence contributes useful information.

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

Completeness4/5

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

For a plotting tool with annotations covering safety, the definition explains the input expression form, axis ranges, grid resolution, return type, and automatic 2D/3D behavior. It lacks explicit failure-mode information and contains the ylim discrepancy, so it is not fully complete.

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 coverage is 100%, so the baseline is 3. The description adds examples and explains the variable-based dimensionality switch, but it conflicts with the schema on ylim: the description says it is 'used in 2D or 3D' while the schema says 'used only for 3D surfaces.' This inconsistency prevents a higher score.

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

Purpose5/5

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

The description opens with a specific verb and resource: 'Plots a 2D or 3D mathematical function from a symbolic expression string.' This clearly distinguishes the tool from sibling plot_vector_field, which handles vector fields rather than scalar functions.

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

Usage Guidelines4/5

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

The description provides clear context for when to use the tool—plotting symbolic mathematical expressions in one or two variables—and conveys the 2D vs. 3D behavior. It does not explicitly name alternatives or state when not to use it, but the intent is unambiguous given the sibling set.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.