Skip to main content
Glama

PubMed MCP Server

generate_pubmed_chart

Create customizable bar, line, and scatter charts from PubMed data. Define axes, titles, and visual encodings like color and size. Generates a PNG image using Vega-Lite for clear visualization of research trends and patterns.

Instructions

Generates a customizable chart (PNG) from structured data. Supports 'bar', 'line', and 'scatter' plots. Requires data values and field mappings for axes. Optional parameters allow for titles, dimensions, and color/size/series encoding. Internally uses Vega-Lite and a canvas renderer to produce a Base64-encoded PNG image.

Input Schema

NameRequiredDescriptionDefault
chartTypeYesRequired. Specifies the type of chart to generate. Options: 'bar', 'line', 'scatter'.
colorFieldNoOptional. The name of the field in `dataValues` to use for color encoding. This can differentiate bars, lines, or points by color based on the values in this field (e.g., 'studyType', 'country').
colorFieldTypeNoOptional. Specifies the data type of the `colorField`. Options: 'nominal', 'ordinal', 'quantitative', 'temporal'. Defaults to 'nominal' if `colorField` is provided and this is omitted.
dataValuesYesRequired. An array of data objects used to plot the chart. Each object represents a data point or bar, structured as key-value pairs (e.g., [{ 'year': '2020', 'articles': 150 }, { 'year': '2021', 'articles': 180 }]). Must contain at least one data object.
heightNoOptional. The height of the chart canvas in pixels. Must be a positive integer. Default: 300.
outputFormatNoSpecifies the output format for the chart. Currently, only 'png' (Portable Network Graphics) is supported and is the default.png
seriesFieldNoOptional. Primarily for line charts. The name of the field in `dataValues` used to create multiple distinct lines (series) on the same chart. Each unique value in this field will correspond to a separate line (e.g., 'drugName' to plot different drug efficacy trends). Often used with `colorField` implicitly or explicitly.
seriesFieldTypeNoOptional. Specifies the data type of the `seriesField`. Options: 'nominal', 'ordinal', 'quantitative', 'temporal'. Defaults to 'nominal' if `seriesField` is provided and this is omitted.
sizeFieldNoOptional. For scatter plots. The name of the field in `dataValues` to use for encoding the size of the points. Larger values in this field will result in larger points on the scatter plot (e.g., 'sampleSize', 'effectMagnitude').
sizeFieldTypeNoOptional. Specifies the data type of the `sizeField`. Options: 'quantitative', 'ordinal'. Defaults to 'quantitative' if `sizeField` is provided and this is omitted.
titleNoOptional. The main title displayed above the chart. If omitted, no title is shown.
widthNoOptional. The width of the chart canvas in pixels. Must be a positive integer. Default: 400.
xFieldYesRequired. The name of the field in `dataValues` to be used for the X-axis (horizontal). This field determines the categories or values along the bottom of the chart (e.g., 'year', 'geneName', 'publicationCount').
xFieldTypeNoOptional. Specifies the data type of the X-axis field. Options: 'nominal' (categories), 'ordinal' (ordered categories), 'quantitative' (numerical), 'temporal' (dates/times). If omitted, a suitable default is chosen based on `chartType` (e.g., 'nominal' for bar charts, 'temporal' for line charts, 'quantitative' for scatter plots).
yFieldYesRequired. The name of the field in `dataValues` to be used for the Y-axis (vertical). This field determines the values plotted upwards on the chart (e.g., 'articles', 'expressionLevel', 'citationCount').
yFieldTypeNoOptional. Specifies the data type of the Y-axis field. Options: 'nominal', 'ordinal', 'quantitative', 'temporal'. Defaults to 'quantitative' if omitted.

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "chartType": { "description": "Required. Specifies the type of chart to generate. Options: 'bar', 'line', 'scatter'.", "enum": [ "bar", "line", "scatter" ], "type": "string" }, "colorField": { "description": "Optional. The name of the field in `dataValues` to use for color encoding. This can differentiate bars, lines, or points by color based on the values in this field (e.g., 'studyType', 'country').", "type": "string" }, "colorFieldType": { "description": "Optional. Specifies the data type of the `colorField`. Options: 'nominal', 'ordinal', 'quantitative', 'temporal'. Defaults to 'nominal' if `colorField` is provided and this is omitted.", "enum": [ "nominal", "ordinal", "quantitative", "temporal" ], "type": "string" }, "dataValues": { "description": "Required. An array of data objects used to plot the chart. Each object represents a data point or bar, structured as key-value pairs (e.g., [{ 'year': '2020', 'articles': 150 }, { 'year': '2021', 'articles': 180 }]). Must contain at least one data object.", "items": { "additionalProperties": {}, "type": "object" }, "minItems": 1, "type": "array" }, "height": { "default": 300, "description": "Optional. The height of the chart canvas in pixels. Must be a positive integer. Default: 300.", "exclusiveMinimum": 0, "type": "integer" }, "outputFormat": { "default": "png", "description": "Specifies the output format for the chart. Currently, only 'png' (Portable Network Graphics) is supported and is the default.", "enum": [ "png" ], "type": "string" }, "seriesField": { "description": "Optional. Primarily for line charts. The name of the field in `dataValues` used to create multiple distinct lines (series) on the same chart. Each unique value in this field will correspond to a separate line (e.g., 'drugName' to plot different drug efficacy trends). Often used with `colorField` implicitly or explicitly.", "type": "string" }, "seriesFieldType": { "description": "Optional. Specifies the data type of the `seriesField`. Options: 'nominal', 'ordinal', 'quantitative', 'temporal'. Defaults to 'nominal' if `seriesField` is provided and this is omitted.", "enum": [ "nominal", "ordinal", "quantitative", "temporal" ], "type": "string" }, "sizeField": { "description": "Optional. For scatter plots. The name of the field in `dataValues` to use for encoding the size of the points. Larger values in this field will result in larger points on the scatter plot (e.g., 'sampleSize', 'effectMagnitude').", "type": "string" }, "sizeFieldType": { "description": "Optional. Specifies the data type of the `sizeField`. Options: 'quantitative', 'ordinal'. Defaults to 'quantitative' if `sizeField` is provided and this is omitted.", "enum": [ "quantitative", "ordinal" ], "type": "string" }, "title": { "description": "Optional. The main title displayed above the chart. If omitted, no title is shown.", "type": "string" }, "width": { "default": 400, "description": "Optional. The width of the chart canvas in pixels. Must be a positive integer. Default: 400.", "exclusiveMinimum": 0, "type": "integer" }, "xField": { "description": "Required. The name of the field in `dataValues` to be used for the X-axis (horizontal). This field determines the categories or values along the bottom of the chart (e.g., 'year', 'geneName', 'publicationCount').", "type": "string" }, "xFieldType": { "description": "Optional. Specifies the data type of the X-axis field. Options: 'nominal' (categories), 'ordinal' (ordered categories), 'quantitative' (numerical), 'temporal' (dates/times). If omitted, a suitable default is chosen based on `chartType` (e.g., 'nominal' for bar charts, 'temporal' for line charts, 'quantitative' for scatter plots).", "enum": [ "nominal", "ordinal", "quantitative", "temporal" ], "type": "string" }, "yField": { "description": "Required. The name of the field in `dataValues` to be used for the Y-axis (vertical). This field determines the values plotted upwards on the chart (e.g., 'articles', 'expressionLevel', 'citationCount').", "type": "string" }, "yFieldType": { "description": "Optional. Specifies the data type of the Y-axis field. Options: 'nominal', 'ordinal', 'quantitative', 'temporal'. Defaults to 'quantitative' if omitted.", "enum": [ "nominal", "ordinal", "quantitative", "temporal" ], "type": "string" } }, "required": [ "chartType", "dataValues", "xField", "yField" ], "type": "object" }

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/cyanheads/pubmed-mcp-server'

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