Skip to main content
Glama

files_run

Destructive

Sets a code cell at the given position and runs it in a sandboxed cloud worker, writing its result back into the spreadsheet. Prefer files_set_formula whenever a formula can accomplish the task; only use code when the functionality is not available in formulas (charts, machine learning, complex transforms, web/API requests). Requires edit permission. language='python' (pandas/numpy) runs code; language='connection' runs an SQL query against a database connection (pass connection_uuid from connections_list; 'code' is the SQL) and lands the result table at the cell. Execution is ASYNCHRONOUS: returns a task id immediately; read the cell with files_read after a few seconds. Signature: files_run(file_uuid, cell, language, code, sheet?, connection_uuid?).

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": {
      "file_uuid": "<file_uuid>",
      "cell": "<cell>",
      "language": "<language>",
      "code": "<code>"
    },
    "name": "files_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
cellYesAnchor cell of the code cell in A1 notation, e.g. 'A1'.
codeYesPython source, or the SQL query when language='connection'.
sheetNoSheet name (defaults to the first sheet).
languageYes
file_uuidYes
connection_uuidNoRequired when language='connection': the database connection UUID (from connections_list) to run the SQL against.

Output Schema

NameRequiredDescriptionDefault
cellYes
noteYes
statusYes
task_idYes
file_uuidYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already cover the safety profile (destructive, non-idempotent, open-world), and the description adds the critical traits they don't: execution is asynchronous and returns a task id immediately, results land back in the sheet, and edit permission is required. It also explains the divergence between the two languages' execution models.

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-loads the action and the sibling alternative before the language details, which is the right order. It is dense but nearly every sentence is load-bearing; the explicit signature at the end is redundant with the input schema.

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

Completeness5/5

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

For a destructive, async, multi-mode tool, the description covers permission requirements, mode selection, async polling, and where the output lands. An output schema exists, so return-value detail is correctly omitted.

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

Parameters4/5

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

Schema coverage is 67%, and the biggest gap — the 'language' enum has no schema description — is fully compensated: the description explains python vs connection, that 'code' holds SQL in connection mode, and that connection_uuid comes from connections_list. The trailing signature line mostly restates the schema rather than adding meaning.

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 + resource ('sets a code cell ... and runs it in a sandboxed cloud worker') plus the side effect of writing the result back into the spreadsheet. It is immediately distinguishable from siblings like files_set_formula and files_write.

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 routing rule: prefer files_set_formula when a formula can do the job, and reserve code for charts, ML, complex transforms, and web/API requests. It also names the follow-up read (files_read) and the prerequisite (edit permission).

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