Skip to main content
Glama

Replace a spreadsheet's file

replace_data_source
Destructive

Replace the file behind an existing data source, keeping its id. Every catalogue already reading it keeps its attachment and its variable, so a transform reading files['products'] goes on working — which is the whole reason to use this rather than creating a second source. Same base64 limits and the same cell-image caveat as create_data_source. The old stored file is deleted; previous cell-image bindings are cleared and their deletion locks are released.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "dataSourceId": "<dataSourceId>",
      "filename": "<filename>",
      "contentBase64": "<contentBase64>",
      "llm_model": "<llm_model>"
    },
    "name": "replace_data_source"
  }
}

Input Schema

NameRequiredDescriptionDefault
filenameYesThe new file's name, including extension.
llm_modelYesThe exact model identifier you (the assistant) are running as, taken from your system prompt or environment (e.g. "claude-opus-4-8", "gpt-5.2"). Used for analytics only. If you do not know your model identifier with certainty, pass "unknown" — never guess.
dataSourceIdYesThe data source to repoint, from list_workspace_sources.
contentBase64YesThe new file's bytes, base64-encoded.
conversation_idNoPass the exact conversation_id from the server's previous response, unchanged. The server provides it on the first call — never invent one, and do not issue parallel tool calls until you have it. Keep passing the same conversation_id for the rest of the conversation, including after later user messages or on a different task; do not reset it when the user starts a new request.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true, and the description goes well beyond them: the old stored file is deleted, cell-image bindings are cleared and their deletion locks released, while attachments and variables are preserved. The only shortfall is that size limits and the cell-image caveat are deferred by cross-reference to create_data_source rather than stated here.

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?

Front-loaded with the action and its payoff, then the destructive consequences, then the caveats — a logical order with no filler. The em-dash aside is dense but still readable rather than wasted.

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?

For a destructive mutation with no output schema, it covers what is destroyed, what survives, and the cross-referenced input constraints. It stops short of saying what the call returns (e.g. the updated source object), which is the one thing an agent might still wonder about.

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 coverage is 100%, so filename, contentBase64, llm_model and conversation_id are already documented; the description reinforces the id-preservation semantics of dataSourceId but adds no syntax or format detail beyond the schema. Baseline 3 applies where the schema carries the parameter load.

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?

States a specific verb and resource ("Replace the file behind an existing data source") plus the key invariant ("keeping its id"), and explicitly distinguishes it from creating a second source, so an agent can separate it from create_data_source without opening either schema.

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

Usage Guidelines5/5

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

Gives an explicit decision rule: use this (rather than creating a second source) precisely because existing catalogues keep their attachment and variable, so a transform reading files['products'] keeps working. That names the alternative and the condition that selects it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources