sheets__create_chart
Access
Requires a project integration connection for sheets.
Call type: Can change resources.
Arguments
Example request
Send this JSON-RPC request through an initialized MCP client. Replace sample identifiers and values before calling the tool. See MCP client setup.
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "sheets__create_chart",
"arguments": {
"spreadsheetId": "example",
"requests": [
{
"addChart": {
"chart": {
"spec": {
"basicChart": {
"chartType": "BAR",
"series": [
{
"series": null
}
]
}
},
"position": {
"overlayPosition": {
"anchorCell": {
"sheetId": 0
}
}
}
}
}
}
]
}
}
}Result
No output schema is published for this tool. The input contract does not define its return fields. Inspect the MCP response content and isError; do not assume a fixed object shape. See the sheets integration reference for provider setup and tool context.
Full schemas
{
"type": "object",
"properties": {
"spreadsheetId": {
"type": "string",
"description": "Google Sheets spreadsheet ID"
},
"requests": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": [
"addChart"
],
"properties": {
"addChart": {
"type": "object",
"required": [
"chart"
],
"properties": {
"chart": {
"type": "object",
"required": [
"spec",
"position"
],
"properties": {
"chartId": {
"type": "integer",
"minimum": 0,
"description": "Optional new unused chart ID. Normally omit this field so Google assigns an ID; do not reuse an existing chart ID."
},
"spec": {
"type": "object",
"description": "Chart specification. Position belongs beside spec on the chart.",
"properties": {
"title": {
"type": "string",
"description": "Short human-readable title for the record."
},
"basicChart": {
"type": "object",
"required": [
"chartType",
"series"
],
"properties": {
"chartType": {
"type": "string",
"enum": [
"BAR",
"LINE",
"AREA",
"COLUMN",
"SCATTER",
"COMBO",
"STEPPED_AREA"
],
"description": "Provide the chart type."
},
"headerCount": {
"type": "integer",
"minimum": 0,
"description": "Provide the header count."
},
"legendPosition": {
"type": "string",
"enum": [
"BOTTOM_LEGEND",
"LEFT_LEGEND",
"RIGHT_LEGEND",
"TOP_LEGEND",
"NO_LEGEND"
],
"description": "Provide the legend position."
},
"domains": {
"type": "array",
"items": {
"type": "object",
"required": [
"domain"
],
"properties": {
"domain": {
"type": "object",
"properties": {
"sourceRange": {
"type": "object",
"required": [
"sources"
],
"properties": {
"sources": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"description": "Grid range with the actual sheet ID from spreadsheet metadata and zero-based, end-exclusive indexes.",
"required": [
"sheetId"
],
"properties": {
"sheetId": {
"type": "integer",
"minimum": 0,
"description": "Provide the sheet id."
},
"startRowIndex": {
"type": "integer",
"minimum": 0,
"description": "Provide the start row index."
},
"endRowIndex": {
"type": "integer",
"minimum": 0,
"description": "Provide the end row index."
},
"startColumnIndex": {
"type": "integer",
"minimum": 0,
"description": "Provide the start column index."
},
"endColumnIndex": {
"type": "integer",
"minimum": 0,
"description": "Provide the end column index."
}
},
"additionalProperties": false
},
"description": "Each source range must span one row or one column. Google validates range dimensions."
}
},
"additionalProperties": false,
"description": "Structured source range details used by the tool."
},
"columnReference": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"description": "Human-readable name for the target record."
}
},
"additionalProperties": false,
"description": "Structured column reference details used by the tool."
}
},
"oneOf": [
{
"properties": {
"sourceRange": {
"description": "Provide the source range."
}
},
"required": [
"sourceRange"
],
"description": "Provide the domain."
},
{
"properties": {
"columnReference": {
"description": "Provide the column reference."
}
},
"required": [
"columnReference"
],
"description": "Provide the domain."
}
],
"description": "Structured domain details used by the tool."
}
},
"description": "One domain item supplied to the tool."
},
"maxItems": 1,
"description": "Provide one or more domain values."
},
"series": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": [
"series"
],
"properties": {
"series": {
"type": "object",
"properties": {
"sourceRange": {
"type": "object",
"required": [
"sources"
],
"properties": {
"sources": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"description": "Grid range with the actual sheet ID from spreadsheet metadata and zero-based, end-exclusive indexes.",
"required": [
"sheetId"
],
"properties": {
"sheetId": {
"type": "integer",
"minimum": 0,
"description": "Provide the sheet id."
},
"startRowIndex": {
"type": "integer",
"minimum": 0,
"description": "Provide the start row index."
},
"endRowIndex": {
"type": "integer",
"minimum": 0,
"description": "Provide the end row index."
},
"startColumnIndex": {
"type": "integer",
"minimum": 0,
"description": "Provide the start column index."
},
"endColumnIndex": {
"type": "integer",
"minimum": 0,
"description": "Provide the end column index."
}
},
"additionalProperties": false
},
"description": "Each source range must span one row or one column. Google validates range dimensions."
}
},
"additionalProperties": false,
"description": "Structured source range details used by the tool."
},
"columnReference": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"description": "Human-readable name for the target record."
}
},
"additionalProperties": false,
"description": "Structured column reference details used by the tool."
}
},
"oneOf": [
{
"properties": {
"sourceRange": {
"description": "Provide the source range."
}
},
"required": [
"sourceRange"
],
"description": "Provide the series."
},
{
"properties": {
"columnReference": {
"description": "Provide the column reference."
}
},
"required": [
"columnReference"
],
"description": "Provide the series."
}
],
"description": "Structured series details used by the tool."
},
"targetAxis": {
"type": "string",
"enum": [
"BOTTOM_AXIS",
"LEFT_AXIS",
"RIGHT_AXIS"
],
"description": "Use a minor axis for the chart type: BOTTOM_AXIS for BAR, LEFT_AXIS or RIGHT_AXIS for other basic charts."
},
"type": {
"type": "string",
"enum": [
"LINE",
"AREA",
"COLUMN"
],
"description": "Provide the type."
}
},
"description": "One sery item supplied to the tool."
},
"description": "Provide one or more sery values."
}
},
"description": "Structured basic chart details used by the tool."
},
"pieChart": {
"type": "object",
"description": "Structured pie chart details used by the tool."
},
"bubbleChart": {
"type": "object",
"description": "Structured bubble chart details used by the tool."
},
"candlestickChart": {
"type": "object",
"description": "Structured candlestick chart details used by the tool."
},
"orgChart": {
"type": "object",
"description": "Structured org chart details used by the tool."
},
"histogramChart": {
"type": "object",
"description": "Structured histogram chart details used by the tool."
},
"waterfallChart": {
"type": "object",
"description": "Structured waterfall chart details used by the tool."
},
"treemapChart": {
"type": "object",
"description": "Structured treemap chart details used by the tool."
},
"scorecardChart": {
"type": "object",
"description": "Structured scorecard chart details used by the tool."
}
},
"not": {
"anyOf": [
{
"required": [
"position"
],
"properties": {
"position": {}
}
},
{
"required": [
"chartType"
],
"properties": {
"chartType": {}
}
},
{
"required": [
"legendPosition"
],
"properties": {
"legendPosition": {}
}
},
{
"required": [
"axis"
],
"properties": {
"axis": {}
}
},
{
"required": [
"domains"
],
"properties": {
"domains": {}
}
},
{
"required": [
"series"
],
"properties": {
"series": {}
}
},
{
"required": [
"headerCount"
],
"properties": {
"headerCount": {}
}
},
{
"required": [
"threeDimensional"
],
"properties": {
"threeDimensional": {}
}
},
{
"required": [
"interpolateNulls"
],
"properties": {
"interpolateNulls": {}
}
},
{
"required": [
"stackedType"
],
"properties": {
"stackedType": {}
}
},
{
"required": [
"lineSmoothing"
],
"properties": {
"lineSmoothing": {}
}
},
{
"required": [
"compareMode"
],
"properties": {
"compareMode": {}
}
},
{
"required": [
"totalDataLabel"
],
"properties": {
"totalDataLabel": {}
}
}
]
},
"oneOf": [
{
"properties": {
"basicChart": {
"description": "Provide the basic chart."
}
},
"required": [
"basicChart"
],
"description": "Provide the spec."
},
{
"properties": {
"pieChart": {
"description": "Provide the pie chart."
}
},
"required": [
"pieChart"
],
"description": "Provide the spec."
},
{
"properties": {
"bubbleChart": {
"description": "Provide the bubble chart."
}
},
"required": [
"bubbleChart"
],
"description": "Provide the spec."
},
{
"properties": {
"candlestickChart": {
"description": "Provide the candlestick chart."
}
},
"required": [
"candlestickChart"
],
"description": "Provide the spec."
},
{
"properties": {
"orgChart": {
"description": "Provide the org chart."
}
},
"required": [
"orgChart"
],
"description": "Provide the spec."
},
{
"properties": {
"histogramChart": {
"description": "Provide the histogram chart."
}
},
"required": [
"histogramChart"
],
"description": "Provide the spec."
},
{
"properties": {
"waterfallChart": {
"description": "Provide the waterfall chart."
}
},
"required": [
"waterfallChart"
],
"description": "Provide the spec."
},
{
"properties": {
"treemapChart": {
"description": "Provide the treemap chart."
}
},
"required": [
"treemapChart"
],
"description": "Provide the spec."
},
{
"properties": {
"scorecardChart": {
"description": "Provide the scorecard chart."
}
},
"required": [
"scorecardChart"
],
"description": "Provide the spec."
}
]
},
"position": {
"type": "object",
"description": "Chart placement, outside spec.",
"properties": {
"overlayPosition": {
"type": "object",
"required": [
"anchorCell"
],
"properties": {
"anchorCell": {
"type": "object",
"required": [
"sheetId"
],
"properties": {
"sheetId": {
"type": "integer",
"minimum": 0,
"description": "Provide the sheet id."
},
"rowIndex": {
"type": "integer",
"minimum": 0,
"description": "Provide the row index."
},
"columnIndex": {
"type": "integer",
"minimum": 0,
"description": "Provide the column index."
}
},
"additionalProperties": false,
"description": "Structured anchor cell details used by the tool."
},
"offsetXPixels": {
"type": "integer",
"description": "Provide the offset xpixels."
},
"offsetYPixels": {
"type": "integer",
"description": "Provide the offset ypixels."
},
"widthPixels": {
"type": "integer",
"minimum": 0,
"description": "Provide the width pixels."
},
"heightPixels": {
"type": "integer",
"minimum": 0,
"description": "Provide the height pixels."
}
},
"description": "Structured overlay position details used by the tool."
},
"newSheet": {
"type": "boolean",
"const": true,
"description": "Provide the new sheet."
},
"sheetId": {
"type": "integer",
"minimum": 0,
"description": "New unused ID for a dedicated chart-only sheet. For an existing grid tab, use overlayPosition.anchorCell.sheetId."
}
},
"additionalProperties": false,
"oneOf": [
{
"properties": {
"overlayPosition": {
"description": "Provide the overlay position."
}
},
"required": [
"overlayPosition"
],
"description": "Provide the position."
},
{
"properties": {
"newSheet": {
"description": "Provide the new sheet."
}
},
"required": [
"newSheet"
],
"description": "Provide the position."
},
{
"properties": {
"sheetId": {
"description": "Provide the sheet id."
}
},
"required": [
"sheetId"
],
"description": "Provide the position."
}
]
}
},
"description": "Structured chart details used by the tool."
}
},
"additionalProperties": false,
"description": "Structured add chart details used by the tool."
}
},
"additionalProperties": false,
"description": "One request item supplied to the tool."
},
"description": "Provide one or more request values."
}
},
"required": [
"spreadsheetId",
"requests"
],
"description": "Arguments for the sheets__create_chart tool."
}