Skip to main content
Glama
marekrost

mcp-server-spreadsheet

delete_rows

Remove specified rows from a spreadsheet file to clean up data or reorganize content, shifting remaining rows upward automatically.

Instructions

Delete one or more rows, shifting remaining rows up.

All data in the deleted rows is permanently removed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesPath to the spreadsheet file
rowYes1-based index of the first row to delete
countNoNumber of consecutive rows to delete starting from row
sheetNoSheet name. Defaults to the first sheet if omitted.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The 'delete_rows' MCP tool handler, which loads the workbook, resolves the sheet, calls 'delete_rows' on the worksheet, and saves the file.
    @mcp.tool()
    def delete_rows(
        file: Annotated[str, Field(description="Path to the spreadsheet file")],
        row: Annotated[int, Field(description="1-based index of the first row to delete")],
        count: Annotated[int, Field(description="Number of consecutive rows to delete starting from row")] = 1,
        sheet: Annotated[str | None, Field(description="Sheet name. Defaults to the first sheet if omitted.")] = None,
    ) -> str:
        """Delete one or more rows, shifting remaining rows up.
    
        All data in the deleted rows is permanently removed.
        """
        wb = load_workbook(file)
        ws = _resolve_sheet(wb, sheet)
        ws.delete_rows(row, count)
        wb.save(file)
        return f"Deleted {count} rows starting at row {row}"
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that data is 'permanently removed,' which is crucial for a destructive operation, and mentions the shifting behavior. However, it lacks details on permissions required, error handling (e.g., if rows don't exist), or what the output schema might return. The transparency is adequate but minimal for a destructive tool.

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 extremely concise with two sentences that are front-loaded: the first states the core action and effect, and the second warns about permanent data loss. Every word earns its place, with no redundancy or fluff, making it efficient and easy to parse.

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

Completeness3/5

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

Given that this is a destructive tool with no annotations but a rich input schema (100% coverage) and an output schema (implied by context signals), the description is minimally complete. It covers the basic action and permanence but lacks context on alternatives, permissions, or error scenarios. The output schema existence reduces the need to explain return values, but more behavioral detail would improve completeness.

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 fully documents all parameters (file, row, count, sheet). The description adds no additional meaning beyond what the schema provides, such as clarifying parameter interactions or edge cases. Baseline 3 is appropriate as the schema does the heavy lifting, but the description doesn't enhance understanding.

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 ('Delete one or more rows') and the resource ('rows'), with the additional detail about shifting remaining rows up. It distinguishes from siblings like 'clear_range' (which clears content but doesn't delete structure) and 'delete_sheet' (which deletes entire sheets). However, it doesn't explicitly mention spreadsheets, which is implied but could be more specific.

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 like 'clear_range' (for clearing content without deletion) or 'delete_sheet' (for deleting entire sheets). It also doesn't mention prerequisites such as needing an existing spreadsheet file or sheet. Usage is implied by the action but not explicitly contextualized.

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