Skip to main content
Glama
Google Workspace MCP connector

Google Workspace MCP connector

by animesh-ex

script_run

Executes an Apps Script function and returns its result or error with stack trace; set devMode=true to run the latest saved code.

Instructions

Run a function in an Apps Script project and return its result (or error and stack trace). devMode=true runs the latest saved code. Requires: the script's GCP project set to this connector's project, an API executable deployment (script_deploy), and the script authorized once in the editor. Confirm with the user before running code that sends email, edits many rows or deletes data.

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": {
      "scriptId": "<scriptId>",
      "function": "<function>"
    },
    "name": "script_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
devModeNo
functionYes
scriptIdYes
parametersNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.7.0

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the annotations by disclosing the return contract (result, or error plus stack trace), the devMode=true meaning (runs latest saved code), and the auth/deployment prerequisites. The caution about email-sending and data-deleting code usefully tempers the destructiveHint=false flag, though an agent could still read that annotation as license to run risky code without confirmation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two dense sentences, front-loaded with purpose and return contract, then prerequisites and safety note. Every clause carries information, though the prerequisite list is packed into one sentence and could be easier to scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers purpose, return value, devMode, and setup prerequisites, which is substantial for a tool with no output schema. However, for an execution tool with an unexplained 'parameters' array and scriptId, an agent lacks enough to construct a call without inspecting the schema further.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must carry parameter meaning. It explains devMode clearly and 'function' is implied by name, but scriptId (format/source) and the 'parameters' argument array are never described, leaving half the inputs ambiguous.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Run a function in an Apps Script project') and adds the return contract ('result (or error and stack trace)'). This is distinct from siblings like script_deploy or script_get_content without needing to name them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit preconditions for use (GCP project alignment, API executable deployment via script_deploy, one-time authorization) and a caution about confirming destructive/email-sending runs. It does not explicitly say when to prefer a sibling such as script_get_content for inspection, so it stops short of full routing guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools