Skip to main content
Glama
adexltd

MCP Google Suite

by adexltd

sheets_get_values

Retrieve data from specified ranges in Google Sheets to access spreadsheet information for analysis or integration.

Instructions

Get values from a Google Sheet range

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spreadsheet_idYesID of the spreadsheet
rangeYesA1 notation range

Implementation Reference

  • MCP tool handler for sheets_get_values: validates input, logs, calls SheetsService.get_values, returns result
    async def _handle_sheets_get_values(
        self, context: GoogleWorkspaceContext, arguments: dict
    ) -> Dict[str, Any]:
        """Handle sheets get values requests."""
        spreadsheet_id = arguments.get("spreadsheet_id")
        range_name = arguments.get("range")
    
        if not spreadsheet_id or not range_name:
            raise ValueError("Both spreadsheet_id and range are required")
    
        logger.debug(f"Getting sheet values - ID: {spreadsheet_id}, Range: {range_name}")
        result = await context.sheets.get_values(
            spreadsheet_id=spreadsheet_id, range_name=range_name
        )
        logger.debug(f"Sheet values retrieved - Row count: {len(result.get('values', []))}")
        return result
  • Input schema definition for the sheets_get_values tool
    types.Tool(
        name="sheets_get_values",
        description="Get values from a Google Sheet range",
        inputSchema={
            "type": "object",
            "properties": {
                "spreadsheet_id": {
                    "type": "string",
                    "description": "ID of the spreadsheet",
                },
                "range": {"type": "string", "description": "A1 notation range"},
            },
            "required": ["spreadsheet_id", "range"],
        },
    ),
  • Dynamic registration of tool handlers into _tool_registry based on _get_tools_list()
    # 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 in SheetsService: calls Google Sheets API spreadsheets.values.get to retrieve values from the specified range
    def get_values(self, spreadsheet_id: str, range_name: str) -> Dict[str, Any]:
        """Get values from a specific range in a spreadsheet."""
        try:
            result = (
                self.service.spreadsheets()
                .values()
                .get(spreadsheetId=spreadsheet_id, range=range_name)
                .execute()
            )
    
            return {"success": True, "values": result.get("values", [])}
        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 reads values, which implies it's non-destructive, but doesn't cover critical aspects like authentication requirements, rate limits, error handling, or return format (e.g., array structure). This leaves significant gaps for an agent.

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 waste. It front-loads the core purpose ('Get values') and is appropriately sized for a simple read operation, making it easy to parse.

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 the tool's moderate complexity (a read operation with no output schema) and lack of annotations, the description is incomplete. It doesn't explain what the return values look like (e.g., a 2D array), potential errors, or usage constraints, leaving the agent under-informed.

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 both parameters ('spreadsheet_id' and 'range') adequately. The description adds no additional meaning beyond what the schema provides, such as examples of range formats or ID sourcing, meeting the baseline for high coverage.

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 verb ('Get') and resource ('values from a Google Sheet range'), making the tool's function immediately understandable. However, it doesn't differentiate from potential sibling tools like 'sheets_update_values' beyond the basic action, missing explicit contrast.

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?

No guidance is provided on when to use this tool versus alternatives. While the description implies it's for reading data, it doesn't mention when to choose it over other read operations or what prerequisites might exist (e.g., access permissions).

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

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/adexltd/mcp-google-suite'

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