goal_seek
Determine the input value that makes a formula reach a specified target, then write the solved value back to the workbook.
Instructions
Find a variable cell value that makes an expression evaluate to a target and write the result.
Args: file_path: Workbook path. sheet_name: Worksheet containing the expression. variable_cell: Cell reference to adjust (e.g. "B2"). expression: Arithmetic expression referencing worksheet cells (string). target_value: Numeric target value for the expression. initial_value: Starting guess for the solver. tolerance: Convergence tolerance. max_iterations: Maximum solver iterations.
Returns: dict: Result with solved value, status, and iterations used.
Notes: - Destructive: writes the solved value back to the workbook. - Recommend adding a short example expression in docs.
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_path": "<file_path>",
"sheet_name": "<sheet_name>",
"variable_cell": "<variable_cell>",
"expression": "<expression>",
"target_value": "<target_value>"
},
"name": "goal_seek"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| tolerance | No | ||
| expression | Yes | ||
| sheet_name | Yes | ||
| target_value | Yes | ||
| initial_value | No | ||
| variable_cell | Yes | ||
| max_iterations | No |