-
Notifications
You must be signed in to change notification settings - Fork 136
readSpreadsheet ignores valueRenderOption parameter #65
Copy link
Copy link
Closed
Description
Bug Description
The readSpreadsheet tool accepts a valueRenderOption parameter (with options FORMATTED_VALUE, UNFORMATTED_VALUE, FORMULA), but the parameter is never passed through to the Google Sheets API call. This means requesting FORMULA still returns computed/formatted values instead of the actual formula strings.
Steps to Reproduce
- Create a spreadsheet with a formula in a cell (e.g.,
=SUM(A1:A5)) - Call
readSpreadsheetwithvalueRenderOption: "FORMULA" - Observe that the result contains the computed value (e.g.,
"15") instead of the formula string (e.g.,"=SUM(A1:A5)")
Root Cause
Two places where the parameter is dropped:
-
src/tools/sheets/readSpreadsheet.ts(line 30) —args.valueRenderOptionis not passed to the helper:const response = await SheetsHelpers.readRange(sheets, args.spreadsheetId, args.range);
-
src/googleSheetsApiHelpers.ts—readRange()doesn't accept or forward the parameter tosheets.spreadsheets.values.get().
Expected Behavior
When valueRenderOption: "FORMULA" is passed, the API should return formula strings (e.g., "=SUM(A1:A5)") instead of computed values.
Fix
- Add
valueRenderOptionparameter toreadRange()in the helpers file - Pass
args.valueRenderOptionin the tool'sexecutecall - Forward it to
sheets.spreadsheets.values.get({ spreadsheetId, range, valueRenderOption })
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels