script.scripts.run
Executes a specified function in an Apps Script project headlessly and returns its response, surfacing script-side failures as tool errors.
Instructions
Executes a function in an Apps Script project (Apps Script API script.run). The script runs headlessly with the scopes its manifest declares — review them before calling: arbitrary script code executes with your authorization. Returns the script function's response (OPS_ERROR / ops for failures); script-side failures come back as tool errors, not dead servers. Prefer script processes list to observe running executions and script projects get to read a project's source before running it [HTTP POST] — creates or triggers a change; refused under --readonly safety profiles. Returns the API's response resource as JSON — request body is a JSON ExecutionRequest object accepting devMode, function, parameters, sessionState; pass it via params or whole via body_file
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Extra KEY=VALUE query pairs for endpoints whose parameters Discovery does not describe. | |
| params | No | Parameter map merged into the request; typed parameters win. | |
| dry_run | No | Return the request that would be sent, without sending it. | |
| scriptId | Yes | [URL path segment] The script ID of the script to be executed. Find the script ID on the **Project settings** page under "IDs." As multiple executable APIs can be deployed in new | |
| body_file | No | Read the request body from this file ('-' for stdin) instead of building one from the parameters. The body is a JSON ExecutionRequest object. | |
| request_body | No | Request body of type ExecutionRequest: pass it via `params` (merged into the built body) or whole via `body_file`. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| done | No | ||
| error | No | ||
| response | No |