files_set_formula
Sets a spreadsheet FORMULA at the given cell and returns once it is computed (formulas evaluate synchronously — unlike files_run code, no waiting). This is the preferred way to compute values — use a formula whenever it can do the task; fall back to files_run code only when the functionality is not available in formulas. Use A1-style formulas like 'SUM(A1:A10)', 'B2*1.2', 'VLOOKUP(...)'; a leading '=' is optional. Excel's English notation (',' between arguments, '.' as the decimal point) is converted to the Russian notation the file stores and files_read_code returns (';' between arguments, ',' as the decimal point); formulas already in Russian notation are kept as is. For a tiny in-cell chart use SPARKLINE, e.g. 'SPARKLINE(B2:M2, {"charttype", "column"})'. Requires edit permission; applied through the collaboration server. To read the computed value, files_read the cell. Signature: files_set_formula(file_uuid, cell, formula, sheet?).
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>",
"formula": "<formula>"
},
"name": "files_set_formula"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cell | Yes | Anchor cell in A1 notation, e.g. 'C2'. | |
| sheet | No | Sheet name (defaults to the first sheet). | |
| formula | Yes | Formula expression, e.g. 'SUM(A1:A10)' or '=A1*2'. | |
| file_uuid | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cell | Yes | ||
| note | No | ||
| file_uuid | Yes | ||
| sequence_number | Yes |