Skip to main content
Glama
josedu90

MCP Google Workspace Server

sheets_update_values

Modify and update specific ranges of data in Google Sheets by providing a spreadsheet ID, A1 notation range, and new values in a 2D array.

Instructions

Update values in a Google Sheet range

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rangeYesA1 notation range
spreadsheet_idYesID of the spreadsheet
valuesYes2D array of values

Implementation Reference

  • MCP tool handler for sheets_update_values: validates arguments and calls SheetsService.update_values
    async def _handle_sheets_update_values(
        self, context: GoogleWorkspaceContext, arguments: dict
    ) -> Dict[str, Any]:
        """Handle sheets update values requests."""
        spreadsheet_id = arguments.get("spreadsheet_id")
        range_name = arguments.get("range")
        values = arguments.get("values")
    
        if not spreadsheet_id or not range_name or values is None:
            raise ValueError("spreadsheet_id, range, and values are required")
    
        logger.debug(f"Updating sheet values - ID: {spreadsheet_id}, Range: {range_name}")
        result = await context.sheets.update_values(
            spreadsheet_id=spreadsheet_id, range_name=range_name, values=values
        )
        logger.debug(f"Sheet values updated - Updated cells: {result.get('updatedCells', 0)}")
        return result
  • Input schema and tool definition for sheets_update_values
    types.Tool(
        name="sheets_update_values",
        description="Update values in a Google Sheet range",
        inputSchema={
            "type": "object",
            "properties": {
                "spreadsheet_id": {
                    "type": "string",
                    "description": "ID of the spreadsheet",
                },
                "range": {"type": "string", "description": "A1 notation range"},
                "values": {
                    "type": "array",
                    "items": {"type": "array", "items": {"type": "string"}},
                    "description": "2D array of values",
                },
            },
            "required": ["spreadsheet_id", "range", "values"],
        },
    ),
  • Dynamic registration of all tool handlers, including sheets_update_values, into the tool registry
    # Register tool handlers
    for tool in self._get_tools_list():
        handler_name = f"_handle_{tool.name}"
        if hasattr(self, handler_name):
            handler = getattr(self, handler_name)
            self._tool_registry[tool.name] = handler
            logger.debug(f"Registered handler for {tool.name}")
  • Core implementation of updating values in Google Sheets using the API
    def update_values(
        self,
        spreadsheet_id: str,
        range_name: str,
        values: List[List[Any]],
        major_dimension: str = "ROWS",
    ) -> Dict[str, Any]:
        """Update values in a specific range of a spreadsheet."""
        try:
            body = {"values": values, "majorDimension": major_dimension}
    
            result = (
                self.service.spreadsheets()
                .values()
                .update(
                    spreadsheetId=spreadsheet_id,
                    range=range_name,
                    valueInputOption="USER_ENTERED",
                    body=body,
                )
                .execute()
            )
    
            return {"success": True, "result": result}
        except HttpError as error:
            return {"success": False, **self.handle_error(error)}
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool updates values but doesn't explain critical behaviors: whether this overwrites existing data, requires specific permissions, has rate limits, or what happens on success/failure. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding how the tool operates.

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 with zero wasted words. It front-loads the core purpose ('Update values in a Google Sheet range') without unnecessary elaboration. Every word earns its place, 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.

Completeness2/5

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

Given this is a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't cover behavioral traits (e.g., overwrite behavior, error conditions), return values, or usage context. While the schema fully describes parameters, the overall tool understanding remains inadequate for safe and effective use.

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 description coverage is 100%, so the schema already documents all three parameters (range, spreadsheet_id, values) with basic descriptions. The description adds no additional semantic context about parameters, such as format examples for 'A1 notation' or what constitutes valid values in the 2D array. Baseline 3 is appropriate when the schema does the heavy lifting.

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 action ('Update values') and resource ('in a Google Sheet range'), making the tool's purpose immediately understandable. It distinguishes itself from siblings like sheets_create and sheets_get_values by focusing on updating existing data rather than creating new sheets or retrieving values. However, it doesn't specify what type of values can be updated or how the update behaves, which prevents 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 (e.g., needing an existing spreadsheet), exclusions (e.g., not for creating new sheets), or comparisons to sibling tools like sheets_create or sheets_get_values. The agent must infer usage from the name and context alone.

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

Related 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/josedu90/mcp-suiteg'

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