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.
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": {
"script_id": "<script_id>",
"granularity": "<granularity>"
},
"name": "get_project_metrics"
}
}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. |