Skip to main content
Glama
marekrost

mcp-server-spreadsheet

write_cell

Write a value to a specific spreadsheet cell, automatically converting numeric strings to numbers and text to strings.

Instructions

Write a single value to a cell.

Overwrites any existing value. The value is type-coerced: numeric strings become numbers, all else is text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesPath to the spreadsheet file
cellYesTarget cell in A1 notation, e.g. 'B3'
valueYesValue to write. Numeric strings are coerced to numbers, everything else is stored as text.
sheetNoSheet name. Defaults to the first sheet if omitted.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The implementation of the write_cell tool, which updates a specific cell in a spreadsheet file.
    def write_cell(
        file: Annotated[str, Field(description="Path to the spreadsheet file")],
        cell: Annotated[str, Field(description="Target cell in A1 notation, e.g. 'B3'")],
        value: Annotated[object, Field(description="Value to write. Numeric strings are coerced to numbers, everything else is stored as text.")],
        sheet: Annotated[str | None, Field(description="Sheet name. Defaults to the first sheet if omitted.")] = None,
    ) -> str:
        """Write a single value to a cell.
    
        Overwrites any existing value. The value is type-coerced: numeric
        strings become numbers, all else is text.
        """
        wb = load_workbook(file)
        ws = _resolve_sheet(wb, sheet)
        row, col = parse_cell(cell)
        ws.set_cell(row, col, coerce_value(value))
        wb.save(file)
        return f"Wrote to {cell}"
  • Registration of the write_cell tool using the @mcp.tool() decorator.
    @mcp.tool()
Behavior4/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 clearly states that the tool 'overwrites any existing value' (destructive behavior) and describes type coercion rules ('numeric strings become numbers, all else is text'), which are important behavioral traits not evident from the schema alone. However, it doesn't mention permissions, error conditions, or response format.

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 - just three sentences with zero waste. The first sentence states the core purpose, the second describes the destructive behavior, and the third explains type coercion. Every sentence earns its place and the information is front-loaded appropriately.

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 that there's an output schema (though not shown here), the description doesn't need to explain return values. For a mutation tool with no annotations, it does a good job covering the key behavioral aspects (overwriting, type coercion) but could be more complete by mentioning permissions or error handling. The presence of sibling tools suggests more contextual guidance would be helpful.

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 all parameters thoroughly. The description adds minimal value beyond the schema - it mentions type coercion for the 'value' parameter, but this is already covered in the schema's description for that parameter. The baseline of 3 is appropriate when the schema does the heavy lifting.

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 ('Write a single value to a cell'), identifies the resource ('a cell'), and distinguishes it from siblings like 'write_range' by specifying it's for a single cell rather than a range. The verb 'write' is precise and unambiguous.

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

Usage Guidelines3/5

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

The description implies usage for writing to individual cells, but does not explicitly state when to use this tool versus alternatives like 'write_range' or 'append_rows'. It provides some context about type coercion and overwriting, but lacks explicit guidance on tool selection among siblings.

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