Run Code
run_codeExecute Google Apps Script as the user and return results with logs. Access built-in services like SpreadsheetApp and UrlFetchApp, opening files by ID or URL because no active document is set.
Instructions
Run Apps Script (JavaScript, V8) as the user and return the result and logs.
code is a function body: use return to send back a JSON-serializable
value. All built-in services are available (SpreadsheetApp, DocumentApp,
DriveApp, GmailApp, CalendarApp, UrlFetchApp, ...). console.log and
Logger.log output is returned in logs. There is no active document, so
open files by ID or URL. Executions stop after 6 minutes.
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": {
"code": "<code>"
},
"name": "run_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||