Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
HOSTNoHost to bind the server (for SSE transport).0.0.0.0
PORTNoPort to listen on (for SSE transport).8000
TOKEN_PATHNoPath to store the generated OAuth token.token.json
ENABLED_TOOLSNoComma-separated list of tool names to enable (e.g., 'get_sheet_data,update_cells').
DRIVE_FOLDER_IDNoID of the Google Drive folder shared with the Service Account.
CREDENTIALS_PATHNoPath to the OAuth 2.0 Client ID JSON file.credentials.json
CREDENTIALS_CONFIGNoBase64 encoded JSON string of credentials content.
SERVICE_ACCOUNT_PATHNoPath to the Service Account JSON key file.
GOOGLE_APPLICATION_CREDENTIALSNoPath to service account key (Google's standard variable) for ADC.

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
get_sheet_dataA

Get data from a specific sheet in a Google Spreadsheet.

Args: spreadsheet_id: The ID of the spreadsheet (found in the URL) sheet: The name of the sheet range: Optional cell range in A1 notation (e.g., 'A1:C10'). If not provided, gets all data. include_grid_data: If True, includes cell formatting and other metadata in the response. Note: Setting this to True will significantly increase the response size and token usage when parsing the response, as it includes detailed cell formatting information. Default is False (returns values only, more efficient).

Returns: Grid data structure with either full metadata or just values from Google Sheets API, depending on include_grid_data parameter

get_sheet_formulasA

Get formulas from a specific sheet in a Google Spreadsheet.

Args: spreadsheet_id: The ID of the spreadsheet (found in the URL) sheet: The name of the sheet range: Optional cell range in A1 notation (e.g., 'A1:C10'). If not provided, gets all formulas from the sheet.

Returns: A 2D array of the sheet formulas.

update_cellsB

Update cells in a Google Spreadsheet.

Args: spreadsheet_id: The ID of the spreadsheet (found in the URL) sheet: The name of the sheet range: Cell range in A1 notation (e.g., 'A1:C10') data: 2D array of values to update

Returns: Result of the update operation

batch_update_cellsA

Batch update multiple ranges in a Google Spreadsheet.

Args: spreadsheet_id: The ID of the spreadsheet (found in the URL) sheet: The name of the sheet ranges: Dictionary mapping range strings to 2D arrays of values e.g., {'A1:B2': [[1, 2], [3, 4]], 'D1:E2': [['a', 'b'], ['c', 'd']]}

Returns: Result of the batch update operation

add_rowsB

Add rows to a sheet in a Google Spreadsheet.

Args: spreadsheet_id: The ID of the spreadsheet (found in the URL) sheet: The name of the sheet count: Number of rows to add start_row: 0-based row index to start adding. If not provided, adds at the beginning.

Returns: Result of the operation

add_columnsA

Add columns to a sheet in a Google Spreadsheet.

Args: spreadsheet_id: The ID of the spreadsheet (found in the URL) sheet: The name of the sheet count: Number of columns to add start_column: 0-based column index to start adding. If not provided, adds at the beginning.

Returns: Result of the operation

list_sheetsA

List all sheets in a Google Spreadsheet.

Args: spreadsheet_id: The ID of the spreadsheet (found in the URL)

Returns: List of sheet names

copy_sheetB

Copy a sheet from one spreadsheet to another.

Args: src_spreadsheet: Source spreadsheet ID src_sheet: Source sheet name dst_spreadsheet: Destination spreadsheet ID dst_sheet: Destination sheet name

Returns: Result of the operation

rename_sheetC

Rename a sheet in a Google Spreadsheet.

Args: spreadsheet: Spreadsheet ID sheet: Current sheet name new_name: New sheet name

Returns: Result of the operation

get_multiple_sheet_dataA

Get data from multiple specific ranges in Google Spreadsheets.

Args: queries: A list of dictionaries, each specifying a query. Each dictionary should have 'spreadsheet_id', 'sheet', and 'range' keys. Example: [{'spreadsheet_id': 'abc', 'sheet': 'Sheet1', 'range': 'A1:B5'}, {'spreadsheet_id': 'xyz', 'sheet': 'Data', 'range': 'C1:C10'}]

Returns: A list of dictionaries, each containing the original query parameters and the fetched 'data' or an 'error'.

get_multiple_spreadsheet_summaryA

Get a summary of multiple Google Spreadsheets, including sheet names, headers, and the first few rows of data for each sheet.

Args: spreadsheet_ids: A list of spreadsheet IDs to summarize. rows_to_fetch: The number of rows (including header) to fetch for the summary (default: 5).

Returns: A list of dictionaries, each representing a spreadsheet summary. Includes spreadsheet title, sheet summaries (title, headers, first rows), or an error.

create_spreadsheetA

Create a new Google Spreadsheet.

Args: title: The title of the new spreadsheet folder_id: Optional Google Drive folder ID where the spreadsheet should be created. If not provided, uses the configured default folder or creates in root.

Returns: Information about the newly created spreadsheet including its ID

create_sheetA

Create a new sheet tab in an existing Google Spreadsheet.

Args: spreadsheet_id: The ID of the spreadsheet title: The title for the new sheet

Returns: Information about the newly created sheet

list_spreadsheetsA

List all spreadsheets in the specified Google Drive folder. If no folder is specified, uses the configured default folder or lists from 'My Drive'.

Args: folder_id: Optional Google Drive folder ID to search in. If not provided, uses the configured default folder or searches 'My Drive'.

Returns: List of spreadsheets with their ID and title

share_spreadsheetA

Share a Google Spreadsheet with multiple users via email, assigning specific roles.

Args: spreadsheet_id: The ID of the spreadsheet to share. recipients: A list of dictionaries, each containing 'email_address' and 'role'. The role should be one of: 'reader', 'commenter', 'writer'. Example: [ {'email_address': 'user1@example.com', 'role': 'writer'}, {'email_address': 'user2@example.com', 'role': 'reader'} ] send_notification: Whether to send a notification email to the users. Defaults to True.

Returns: A dictionary containing lists of 'successes' and 'failures'. Each item in the lists includes the email address and the outcome.

list_foldersA

List all folders in the specified Google Drive folder. If no parent folder is specified, lists folders from 'My Drive' root.

Args: parent_folder_id: Optional Google Drive folder ID to search within. If not provided, searches the root of 'My Drive'.

Returns: List of folders with their ID, name, and parent information

search_spreadsheetsA

Search for spreadsheets in Google Drive by name or content.

Args: query: Search query string. Searches in file name and content. Examples: "budget 2024", "sales report", "project tracker" max_results: Maximum number of results to return (default 20, max 100)

Returns: List of matching spreadsheets with their ID, name, and metadata

find_in_spreadsheetA

Find cells containing a specific value in a Google Spreadsheet.

Args: spreadsheet_id: The ID of the spreadsheet (found in the URL) query: The text to search for in cell values sheet: Optional sheet name to search in. If not provided, searches all sheets. case_sensitive: Whether the search should be case-sensitive (default False) max_results: Maximum number of results to return (default 50)

Returns: List of found cells with their location (sheet, cell in A1 notation) and value

batch_updateA

Execute a batch update on a Google Spreadsheet using the full batchUpdate endpoint. This provides access to all batchUpdate operations including adding sheets, updating properties, inserting/deleting dimensions, formatting, and more.

Args: spreadsheet_id: The ID of the spreadsheet (found in the URL) requests: A list of request objects. Each request object can contain any valid batchUpdate operation. Common operations include: - addSheet: Add a new sheet - updateSheetProperties: Update sheet properties (title, grid properties, etc.) - insertDimension: Insert rows or columns - deleteDimension: Delete rows or columns - updateCells: Update cell values and formatting - updateBorders: Update cell borders - addConditionalFormatRule: Add conditional formatting - deleteConditionalFormatRule: Remove conditional formatting - updateDimensionProperties: Update row/column properties - and many more...

         Example requests:
         [
             {
                 "addSheet": {
                     "properties": {
                         "title": "New Sheet"
                     }
                 }
             },
             {
                 "updateSheetProperties": {
                     "properties": {
                         "sheetId": 0,
                         "title": "Renamed Sheet"
                     },
                     "fields": "title"
                 }
             },
             {
                 "insertDimension": {
                     "range": {
                         "sheetId": 0,
                         "dimension": "ROWS",
                         "startIndex": 1,
                         "endIndex": 3
                     }
                 }
             }
         ]

Returns: Result of the batch update operation, including replies for each request

add_chartA

Add a chart to a Google Spreadsheet.

Creates a chart from the specified data range with customizable type, title, and positioning. The chart is added as a floating element on the sheet.

Args: spreadsheet_id: The ID of the spreadsheet (found in the URL) sheet: The name of the sheet containing the data chart_type: Type of chart to create. Supported types: - COLUMN: Vertical bar chart - BAR: Horizontal bar chart - LINE: Line chart - AREA: Area chart - PIE: Pie chart - SCATTER: Scatter plot - COMBO: Combination chart - HISTOGRAM: Histogram data_range: A1 notation range for chart data (e.g., 'A1:C10'). The first row is typically treated as headers. title: Optional title for the chart x_axis_label: Optional label for the X axis (bottom axis) y_axis_label: Optional label for the Y axis (left axis) position_x: Horizontal position offset in pixels from the top-left corner (default: 0) position_y: Vertical position offset in pixels from the top-left corner (default: 0) width: Width of the chart in pixels (default: 600) height: Height of the chart in pixels (default: 400)

Returns: Result of the chart creation operation

Examples: Create a column chart showing sales data: add_chart( spreadsheet_id="abc123", sheet="Sales", chart_type="COLUMN", data_range="A1:B13", title="Monthly Sales", x_axis_label="Month", y_axis_label="Revenue ($)" )

Create a pie chart for market share:
add_chart(
    spreadsheet_id="abc123",
    sheet="Market",
    chart_type="PIE",
    data_range="A1:B5",
    title="Market Share by Product"
)
upload_excelA

Upload an Excel (.xlsx/.xls) or CSV file and convert it to a Google Spreadsheet.

Args: file_path: Local file path to the Excel or CSV file title: Optional title for the new spreadsheet (defaults to the filename) folder_id: Optional Google Drive folder ID to place the file in

Returns: The created spreadsheet's ID, title, and URL

export_sheetA

Export (download) a Google Spreadsheet as Excel, CSV, or PDF.

Args: spreadsheet_id: The ID of the spreadsheet format: Export format — 'xlsx', 'csv', 'pdf', or 'ods' output_path: Local file path to save to. Auto-generated if omitted.

Returns: The local file path where the file was saved

format_cellsA

Apply formatting to a range of cells.

Args: spreadsheet_id: The ID of the spreadsheet sheet: Sheet/tab name range: A1 notation range (e.g., 'A1:C10') bold: Make text bold italic: Make text italic font_size: Font size in pt font_color: Hex color for text (e.g., '#FF0000') background_color: Hex color for cell background (e.g., '#FFFF00') number_format: Number format pattern (e.g., '#,##0.00', '0%', 'yyyy-mm-dd') horizontal_alignment: 'LEFT', 'CENTER', or 'RIGHT'

Returns: Result of the formatting operation

merge_cellsA

Merge (or unmerge) cells in a range.

Args: spreadsheet_id: The ID of the spreadsheet sheet: Sheet/tab name range: A1 notation range (e.g., 'A1:C3') merge_type: 'MERGE_ALL', 'MERGE_COLUMNS', 'MERGE_ROWS', or 'UNMERGE'

Returns: Result of the merge operation

auto_resizeA

Auto-resize columns or rows to fit content.

Args: spreadsheet_id: The ID of the spreadsheet sheet: Sheet/tab name dimension: 'COLUMNS' or 'ROWS' start_index: 0-based start index end_index: 0-based end index (exclusive). Omit to resize all.

Returns: Result of the resize operation

sort_rangeA

Sort a range of cells by a column.

Args: spreadsheet_id: The ID of the spreadsheet sheet: Sheet/tab name range: A1 notation range to sort (e.g., 'A1:D100') sort_column: Column letter to sort by (e.g., 'B') order: 'ASCENDING' or 'DESCENDING'

Returns: Result of the sort operation

add_filterB

Add a basic filter (auto-filter) to a range.

Args: spreadsheet_id: The ID of the spreadsheet sheet: Sheet/tab name range: A1 notation range (e.g., 'A1:E100')

Returns: Result of the filter operation

add_pivot_tableB

Create a pivot table from source data.

Args: spreadsheet_id: The ID of the spreadsheet source_sheet: Sheet name containing source data source_range: A1 range of source data (e.g., 'A1:E100') target_sheet: Sheet name to place the pivot table target_cell: Cell to anchor the pivot table (default 'A1') row_columns: List of 0-based column indices for row grouping (e.g., [0, 1]) value_columns: List of 0-based column indices to aggregate (e.g., [3, 4]) aggregation: Aggregation function — 'SUM', 'COUNTA', 'AVERAGE', 'MAX', 'MIN'

Returns: Result of the pivot table creation

add_conditional_formatA

Add a conditional formatting rule to a range.

Args: spreadsheet_id: The ID of the spreadsheet sheet: Sheet/tab name range: A1 notation range (e.g., 'B2:B100') rule_type: Condition type — 'NUMBER_GREATER', 'NUMBER_LESS', 'NUMBER_EQ', 'TEXT_CONTAINS', 'TEXT_NOT_CONTAINS', 'BLANK', 'NOT_BLANK', 'NUMBER_BETWEEN', 'NUMBER_NOT_BETWEEN' values: Condition values (e.g., ['100'] for greater than 100, ['10','50'] for between) background_color: Hex color to apply when condition is met (e.g., '#FF0000')

Returns: Result of the conditional formatting operation

duplicate_sheetA

Duplicate a sheet/tab within the same spreadsheet.

Args: spreadsheet_id: The ID of the spreadsheet sheet: Name of the sheet to duplicate new_name: Name for the duplicated sheet (defaults to 'Copy of ')

Returns: The new sheet's properties

move_sheetA

Move a sheet/tab to a different position (reorder tabs).

Args: spreadsheet_id: The ID of the spreadsheet sheet: Name of the sheet to move index: New 0-based position index

Returns: Result of the move operation

protect_rangeB

Protect a range or entire sheet from editing.

Args: spreadsheet_id: The ID of the spreadsheet sheet: Sheet/tab name range: A1 notation range to protect. Omit to protect the entire sheet. description: Description of the protection warning_only: If True, shows a warning but allows editing editors: List of email addresses allowed to edit

Returns: Result of the protection operation

add_commentA

Add a comment to a spreadsheet. Optionally anchor it to a specific cell.

Args: spreadsheet_id: The ID of the spreadsheet content: The comment text anchor_cell: Cell reference in 'Sheet1!A1' format. If omitted, adds a file-level comment.

Returns: The created comment

get_revision_historyA

Get the revision (edit) history of a spreadsheet.

Args: spreadsheet_id: The ID of the spreadsheet max_results: Maximum number of revisions to return (default 20)

Returns: List of revisions with author, date, and modification details

delete_rows_columnsA

Delete rows or columns from a sheet.

Args: spreadsheet_id: The ID of the spreadsheet sheet: Sheet/tab name dimension: 'ROWS' or 'COLUMNS' start_index: 0-based start index (inclusive) end_index: 0-based end index (exclusive)

Returns: Result of the delete operation

clear_rangeA

Clear data from a range of cells. Optionally clear formatting too.

Args: spreadsheet_id: The ID of the spreadsheet sheet: Sheet/tab name range: A1 notation range (e.g., 'A1:C10') clear_format: If True, also clears formatting. If False (default), only clears values.

Returns: Result of the clear operation

get_commentsA

Get all comments on a spreadsheet.

Args: spreadsheet_id: The ID of the spreadsheet include_resolved: Whether to include resolved comments (default False) max_results: Maximum number of comments to return (default 50)

Returns: List of comments with author, content, anchor cell, and resolved status

resolve_commentB

Resolve a comment, optionally adding a reply before resolving.

Args: spreadsheet_id: The ID of the spreadsheet comment_id: The comment ID (from get_comments) reply_content: Optional reply to add before resolving

Returns: Result of the resolve operation

set_tab_colorA

Change the color of a sheet tab.

Args: spreadsheet_id: The ID of the spreadsheet sheet: Sheet/tab name color: Hex color (e.g., '#FF0000' for red, '#00FF00' for green). Use '#FFFFFF' or 'none' to remove color.

Returns: Result of the color change operation

append_rowsA

Append rows of data after the last row with content in a sheet. Useful for adding log entries or new records without knowing the exact row number.

Args: spreadsheet_id: The ID of the spreadsheet sheet: Sheet/tab name values: List of rows, each row is a list of cell values. Example: [["Alice", 30, "Seoul"], ["Bob", 25, "Busan"]]

Returns: The range where data was appended and number of rows added

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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/socar-edwin/mcp-google-sheets-extended'

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