Skip to main content
Glama

script.projects.updateContent

Replaces all files in an Apps Script project with new HEAD content, ensuring triggers, editor previews, web apps, and API development runs use the updated code.

Instructions

Updates the content of the specified script project. This content is stored as the HEAD version, and is used when the script is executed as a trigger, in the script editor, in add-on preview mode, or as a web app or Apps Script API in development mode. This clears all the existing files in the project [HTTP PUT] — updates the resource; refused under --readonly safety profiles. Returns the API's response resource as JSON — request body is a JSON Content object accepting files, scriptId; pass it via params or whole via body_file Siblings over the same resource: create, get, getContent, getMetrics.

Input Schema

NameRequiredDescriptionDefault
queryNoExtra KEY=VALUE query pairs for endpoints whose parameters Discovery does not describe.
paramsNoParameter map merged into the request; typed parameters win.
dry_runNoReturn the request that would be sent, without sending it.
scriptIdYes[URL path segment] The script project's Drive ID.
body_fileNoRead the request body from this file ('-' for stdin) instead of building one from the parameters. The body is a JSON Content object.
request_bodyNoRequest body of type Content: pass it via `params` (merged into the built body) or whole via `body_file`.

Output Schema

NameRequiredDescriptionDefault
filesNo
scriptIdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / body_file / description
      Previous value: -"Read the request body from this file ('-' for stdin) instead of building one from the parameters."New value: +"Read the request body from this file ('-' for stdin) instead of building one from the parameters. The body is a JSON Content object."
    • addedInput schema / properties / request_body
      Added value: +{
      +  "description": "Request body of type Content: pass it via `params` (merged into the built body) or whole via `body_file`.",
      +  "properties": {
      +    "files": {
      +      "items": {
      +        "properties": {
      +          "createTime": {
      +            "type": "string"
      +          },
      +          "functionSet": {
      +            "properties": {
      +              "values": {
      +                "items": {
      +                  "properties": {
      +                    "name": {
      +                      "type": "string"
      +                    },
      +                    "parameters": {
      +                      "items": {
      +                        "type": "string"
      +                      },
      +                      "type": "array"
      +                    }
      +                  },
      +                  "type": "object"
      +                },
      +                "type": "array"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "lastModifyUser": {
      +            "properties": {
      +              "domain": {
      +                "type": "string"
      +              },
      +              "email": {
      +                "type": "string"
      +              },
      +              "name": {
      +                "type": "string"
      +              },
      +              "photoUrl": {
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "name": {
      +            "type": "string"
      +          },
      +          "source": {
      +            "type": "string"
      +          },
      +          "type": {
      +            "enum": [
      +              "ENUM_TYPE_UNSPECIFIED",
      +              "SERVER_JS",
      +              "HTML",
      +              "JSON"
      +            ],
      +            "type": "string"
      +          },
      +          "updateTime": {
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "scriptId": {
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed2 schema fields changed
    • changedInput schema / properties / scriptId / description
      Previous value: -"The script project's Drive ID."New value: +"[URL path segment] The script project's Drive ID."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "files": {
      +      "items": {
      +        "properties": {
      +          "createTime": {
      +            "type": "string"
      +          },
      +          "functionSet": {
      +            "properties": {
      +              "values": {
      +                "items": {
      +                  "properties": {
      +                    "name": {
      +                      "type": "string"
      +                    },
      +                    "parameters": {
      +                      "items": {
      +                        "type": "string"
      +                      },
      +                      "type": "array"
      +                    }
      +                  },
      +                  "type": "object"
      +                },
      +                "type": "array"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "lastModifyUser": {
      +            "properties": {
      +              "domain": {
      +                "type": "string"
      +              },
      +              "email": {
      +                "type": "string"
      +              },
      +              "name": {
      +                "type": "string"
      +              },
      +              "photoUrl": {
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "name": {
      +            "type": "string"
      +          },
      +          "source": {
      +            "type": "string"
      +          },
      +          "type": {
      +            "enum": [
      +              "ENUM_TYPE_UNSPECIFIED",
      +              "SERVER_JS",
      +              "HTML",
      +              "JSON"
      +            ],
      +            "type": "string"
      +          },
      +          "updateTime": {
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "scriptId": {
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  3. First observed

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations at all, the description carries the full burden and does so: it discloses the destructive semantics ('clears all the existing files in the project'), the HTTP PUT verb, that the call is refused under --readonly safety profiles, and that the response is the API resource as JSON. That is precisely the mutation-risk context an agent needs before invoking it.

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?

Purpose is front-loaded and almost every clause carries new information (destructive effect, readonly refusal, body plumbing). It is a single dense run-on paragraph with bracketed asides like '[HTTP PUT]' and em-dash insertions that make it slightly harder to scan, but there is little actual waste.

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

Completeness5/5

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

For a destructive, nested-body, 6-parameter mutation with an output schema present, the definition covers everything an agent needs: what gets destroyed, safety-profile behavior, how to pass the body, and that the return is the API resource. Return-value detail is correctly left to the output schema.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds real guidance the schema does not: the body is a JSON Content object accepting files and scriptId, and it can be supplied either via `params` (merged) or wholesale via `body_file`. That clarifies how the multiple body-passing parameters interact.

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 ('Updates the content of the specified script project') and immediately scopes it to the HEAD version. It also enumerates the sibling operations on the same resource (create, get, getContent, getMetrics), so the agent can tell it apart from getContent without opening a schema.

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?

Explains the contexts in which the HEAD content matters (trigger execution, editor, add-on preview, web app/dev-mode API), which tells the agent when this call has effect. Siblings are listed but no explicit routing rule ('use getContent instead when...') is given, so it stops short of full when/when-not 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