Skip to main content
Glama

add_sheet_named_range

Creates a named range in Google Sheets to replace cell references with a readable name, making formulas easier to maintain.

Instructions

Define a named range that formulas and scripts can reference by name.

Creates a persistent alias for a range — e.g., =SUM(TaxRate) instead of =SUM(Config!B2:B2). Named ranges show up in the Data > Named ranges sidebar and in formula autocomplete. Makes formulas more readable and lets you move the underlying cells without breaking references. To use the named range, write it bare in a formula (=TaxRate) — no quotes, no sheet prefix.

Requires OAuth scope: https://www.googleapis.com/auth/spreadsheets (write).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_google_emailYes
spreadsheet_idYesGoogle Sheets spreadsheet ID (from the URL after `/d/`).
nameYesIdentifier for the range. Must start with a letter or underscore; can contain letters, digits, underscores. No spaces or special characters. Cannot be the same as an A1 cell reference (e.g., `A1`, `B2` are rejected). Examples: `TaxRate`, `Q1_Revenue`, `_Config`.
range_nameYesA1-notation range being named. Sheet name required for multi-sheet workbooks, e.g., `"Sheet1!A1:B10"`, `"Config!B2"`. Single cells work (`Sheet1!B2`). Full-column/row refs (`Sheet1!A:A`, `Sheet1!1:1`) are accepted. Sheet names with spaces must be single-quoted: `"'My Sheet'!A1:B5"`.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses the OAuth write scope, but does not mention potential side effects (e.g., overwriting existing named ranges with the same name, behavior on invalid range, or scope of effect beyond the spreadsheet). The description is adequate for a simple creation tool but could be more transparent about conflict resolution.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the main purpose and provides examples in a well-structured manner. However, it is slightly verbose, including details like the Data > Named ranges sidebar and autocomplete behavior. Every sentence adds value, but some conciseness is sacrificed for thoroughness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

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

Given the presence of an output schema (as per context signals), the description need not explain return values. It covers the concept, usage in formulas, and OAuth requirement. However, it lacks information on error handling (e.g., duplicate name or invalid range) and does not reference any prerequisites beyond auth. Overall, it provides solid context but has minor gaps.

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 75%, and the schema itself provides detailed descriptions for parameters like 'name' and 'range_name'. The tool description adds no new parameter semantics beyond the schema; it provides usage context (e.g., how to use named ranges in formulas) but does not elaborate on the parameters themselves. Hence, it meets the baseline for the given coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Define a named range that formulas and scripts can reference by name.' It provides specific examples and explains the benefit of readability and reference stability. This distinguishes it from sibling sheet tools like 'add_sheet_data_validation' or 'format_sheet_range'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when to use the tool (to make formulas more readable, allow cell movement without breaking references) and notes the required OAuth scope. However, it does not explicitly mention when not to use it or compare to alternatives like direct A1 references. The context is clear but lacks exclusionary guidance.

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/HuntsDesk/ve-gws'

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