Define variable
define_variableCreate or repoint a readable Excel name for a cell so input and output tools can use a key like Revenue instead of a cell reference.
Instructions
Create a defined name for a cell, or repoint an existing one, so set_inputs and get_outputs can use a readable key ("Revenue") instead of a cell ref. A name that already exists in the same scope is overwritten with the new target; no cell's value or formula changes. Names follow Excel's rules (start with a letter, _ or , no spaces, not a cell ref) and invalid ones fail the call. Returns {name, refers_to, defined_names}, the last being every name after the change. To remove a name use delete_variable; to see the existing names first, use inspect_model.
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": {
"session_id": "<session_id>",
"name": "<name>",
"refers_to": "<refers_to>"
},
"name": "define_variable"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name to create or repoint, following Excel's name rules (e.g. "Revenue", "Exit_Cap") | |
| refers_to | Yes | Cell reference the name points to (e.g. "Sheet1!$A$1") | |
| session_id | Yes | Session ID returned by create_session (list_sessions shows the open ones) | |
| scope_sheet | No | 0-based sheet index for a sheet-scoped name; omit for workbook scope |