Append daily metrics to a Google Sheet from any data source
Quand l'utiliser : You want a lightweight dashboard in Sheets fed by whatever the agent can reach (Sentry, Stripe, a DB).
Prérequis
- Google service account with Sheets + Drive API enabled — console.cloud.google.com → create SA → download JSON → set SERVICE_ACCOUNT_PATH
- Sheet shared with the SA email — Sheets UI → Share → add [email protected] as Editor
Déroulement
-
Identify the target sheetUse mcp-google-sheets to find the spreadsheet titled 'Daily KPIs'. Return its ID.✓ Copié→ Spreadsheet ID
-
Append today's rowAppend a row to sheet 'summary' with columns [date, signups, mrr, errors]. Use today's values from [your source].✓ Copié→ add_rows confirms row appended at the bottom
-
Update a chart if neededVerify the trailing-30d chart picked up the new row; if not, refresh it.✓ Copié→ Chart shows today's data
Résultat : A live Sheets dashboard updated without opening the file.
Pièges
- Rate limit (429) after many single-cell updates — Use
batch_update_cells— one call can modify hundreds of cells - Service account doesn't see the sheet — You must explicitly share the sheet with its email — SAs have no implicit access