Run Function
run_functionExecutes a top-level function from saved Apps Script code and returns its result and logs, so you can test project logic through the MCP bridge.
Instructions
Run a top-level function from a project's saved code and return its result and logs.
The project's .gs files are loaded into the bridge and executed there, so
it runs as the user but outside the real project: there is no active
document (getActiveSpreadsheet() returns null), and the project's own
libraries, advanced services, script properties and triggers are not
available. Only standalone projects can be loaded. args must be JSON-serializable.
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>",
"function_name": "<function_name>"
},
"name": "run_function"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | ||
| script_id | Yes | ||
| function_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||