Get execution metrics
get_project_metricsRetrieve Apps Script execution metrics by day or week: active users, total/failed executions, optionally per deployment. Rising failed executions signal failures to inspect.
Instructions
Returns execution metrics for the project: activeUsers, totalExecutions and failedExecutions as time series ({ value, startTime, endTime }; value is absent when zero). granularity daily covers the last 7 days, weekly aggregates by week. deployment_id narrows the numbers to one deployment. A rising failedExecutions count is the cue to call list_processes with statuses=[FAILED] for the concrete failures. Requires the script.metrics scope.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script_id | Yes | The script project id — from the Apps Script editor URL (script.google.com/home/projects/<scriptId>/edit) or from create_project output. For standalone projects it doubles as the Drive file id. | |
| granularity | Yes | daily = last 7 days per day; weekly = per week. | |
| deployment_id | No | Only count executions of this deployment. |