Skip to main content
Glama

sheets_unmerge_cells

Unmerge cells in Google Sheets to separate merged data ranges, enhancing spreadsheet organization and data manipulation. Specify spreadsheet ID and range for targeted unmerging.

Instructions

Unmerge cells in a Google Sheet

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rangeYes
spreadsheetIdYes

Implementation Reference

  • The primary handler function that executes the sheets_unmerge_cells tool. It validates the input using Zod, authenticates the Google Sheets client, resolves the sheet ID, parses the range, and sends a batchUpdate request with the unmergeCells operation.
    export async function unmergeCellsHandler(input: any): Promise<ToolResponse> {
      try {
        const validatedInput = unmergeCellsInputSchema.parse(input) as UnmergeCellsInput;
        const sheets = await getAuthenticatedClient();
    
        // Extract sheet name and get sheet ID
        const { sheetName, range: cleanRange } = extractSheetName(validatedInput.range);
        const sheetId = await getSheetId(sheets, validatedInput.spreadsheetId, sheetName);
    
        // Parse range to GridRange
        const gridRange = parseRange(cleanRange, sheetId);
    
        // Execute the unmerge
        const response = await sheets.spreadsheets.batchUpdate({
          spreadsheetId: validatedInput.spreadsheetId,
          requestBody: {
            requests: [
              {
                unmergeCells: {
                  range: gridRange,
                },
              },
            ],
          },
        });
    
        return formatToolResponse(`Successfully unmerged cells in range ${validatedInput.range}`, {
          spreadsheetId: response.data.spreadsheetId,
        });
      } catch (error) {
        return handleError(error);
      }
    }
  • The Tool definition for sheets_unmerge_cells, including the inputSchema used for MCP tool listing and validation (spreadsheetId and range required).
    export const unmergeCellsTool: Tool = {
      name: 'sheets_unmerge_cells',
      description: 'Unmerge cells in a Google Sheet',
      inputSchema: {
        type: 'object',
        properties: unmergeCellsInputSchema.shape,
        required: ['spreadsheetId', 'range'],
      },
    };
  • Zod schema for input validation in the unmergeCellsHandler (spreadsheetId: string, range: string).
    const unmergeCellsInputSchema = z.object({
      spreadsheetId: z.string(),
      range: z.string(),
    });
  • src/index.ts:50-50 (registration)
    Registration of the unmergeCellsHandler in the toolHandlers Map for tool execution dispatching.
    ['sheets_unmerge_cells', tools.unmergeCellsHandler],
  • src/index.ts:85-85 (registration)
    Registration of the unmergeCellsTool in the allTools array for ListTools response.
    tools.unmergeCellsTool,
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the action ('unmerge') but lacks behavioral details such as required permissions, whether the operation is destructive to cell content, error conditions, or what happens to formatting. This is inadequate for a mutation tool with zero annotation coverage.

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's appropriately sized and front-loaded, directly stating the tool's purpose without unnecessary elaboration.

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 complexity (mutation tool with 2 parameters), no annotations, no output schema, and 0% schema coverage, the description is incomplete. It lacks crucial details like parameter explanations, behavioral traits, and usage context, making it insufficient for effective tool selection and invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It mentions 'cells' and 'Google Sheet' but doesn't explain the two parameters (spreadsheetId and range) or their semantics (e.g., A1 notation for range). The description adds minimal value beyond what's implied by the tool name.

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 ('unmerge cells') and resource ('in a Google Sheet'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'sheets_merge_cells' beyond the obvious inverse relationship, missing explicit distinction.

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. The description doesn't mention prerequisites (e.g., cells must be merged first), when-not scenarios, or explicit alternatives among the sibling tools listed.

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/freema/mcp-gsheets'

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