Skip to main content
Glama
marekrost

mcp-server-spreadsheet

copy_range

Copy a rectangular cell block to another location within a spreadsheet. Moves raw values between sheets or positions, overwriting existing destination data.

Instructions

Copy a rectangular block of cells to another location.

Copies raw values only. The destination can be on the same sheet or a different sheet in the same workbook. Existing values at the destination are overwritten.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesPath to the spreadsheet file
source_rangeYesRange to copy from in A1 notation, e.g. 'A1:C5'
dest_startYesTop-left cell of the destination, e.g. 'E1'. The copied block expands right and down from here.
sheetNoSource sheet name. Defaults to the first sheet if omitted.
dest_sheetNoDestination sheet name. Defaults to the same sheet as the source if omitted.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The 'copy_range' tool handler, which copies values from a source range to a destination starting cell.
    def copy_range(
        file: Annotated[str, Field(description="Path to the spreadsheet file")],
        source_range: Annotated[str, Field(description="Range to copy from in A1 notation, e.g. 'A1:C5'")],
        dest_start: Annotated[str, Field(description="Top-left cell of the destination, e.g. 'E1'. The copied block expands right and down from here.")],
        sheet: Annotated[str | None, Field(description="Source sheet name. Defaults to the first sheet if omitted.")] = None,
        dest_sheet: Annotated[str | None, Field(description="Destination sheet name. Defaults to the same sheet as the source if omitted.")] = None,
    ) -> str:
        """Copy a rectangular block of cells to another location.
    
        Copies raw values only. The destination can be on the same sheet or
        a different sheet in the same workbook. Existing values at the
        destination are overwritten.
        """
        wb = load_workbook(file)
        src_ws = _resolve_sheet(wb, sheet)
        dst_ws = _resolve_sheet(wb, dest_sheet) if dest_sheet else src_ws
    
        min_col, min_row, max_col, max_row = parse_range(source_range)
        dest_row, dest_col = parse_cell(dest_start)
    
        for r in range(min_row, max_row + 1):
            for c in range(min_col, max_col + 1):
                val = src_ws.cell_value(r, c)
                dst_ws.set_cell(
                    dest_row + (r - min_row),
                    dest_col + (c - min_col),
                    val,
                )
        wb.save(file)
        return f"Copied {source_range} to {dest_start}"
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing key behavioral traits: it copies only raw values (not formulas/formatting), allows cross-sheet copying, and explicitly states that existing destination values are overwritten (destructive behavior). However, it doesn't mention error conditions, permissions, or rate limits.

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 perfectly front-loaded with the core purpose in the first sentence, followed by important behavioral details in two concise sentences. Every sentence earns its place with zero wasted words.

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 this is a mutation tool with no annotations but with an output schema (which handles return values), the description provides good coverage of the core behavior. It could be more complete by mentioning error cases or prerequisites, but it adequately covers the essential what and how for a copy operation.

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 fully documents all 5 parameters. The description adds minimal value beyond the schema - it implies the rectangular nature of the copy and mentions same/different sheet destinations, but doesn't provide additional parameter semantics beyond what's in the schema descriptions.

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 specific action ('Copy a rectangular block of cells') and resource ('to another location'), distinguishing it from siblings like copy_sheet (entire sheet) and copy_workbook (entire workbook). It precisely defines the scope as cell-range copying.

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 provides clear context about when to use this tool ('Copies raw values only', 'destination can be on the same sheet or a different sheet'), but doesn't explicitly mention when NOT to use it or name specific alternatives among the many sibling tools (e.g., copy_sheet for entire sheets).

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/marekrost/mcp-server-spreadsheet'

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