Skip to main content
Glama

Change a Script

helpcenter_update_template_script
DestructiveIdempotent

Change one script: its code (sending src, inlineBody or htmlBody switches it to that kind), position, pages, label or loading flags — or switch it off (enabled:false) without deleting it. Fields left out keep their value.

It edits the help center's design DRAFT (its v2 template): the draft the dashboard's Template Editor opens, with a live preview. Nothing reaches visitors until helpcenter_publish_template — after editing, give the customer the Template Editor link from the result to review, and publish only when they ask. v2 help centers only (a classic one answers template_migration_required). Ids come from helpcenter_get_template.

Once published, the script runs for every visitor: change its code only as the customer asked, from a source they trust. This is the guide's update_script operation.

Args:

  • id (string): the script.

  • position, src | inlineBody | htmlBody, label, pages, enabled, defer, async, integrity, index (optional): what to change.

  • etag (string, optional): from your last read or edit; refuses (stale_draft) if the draft changed since.

Returns: what each entry did (new ids), warnings worth relaying, and the draft status with its new etag.

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": {
      "id": "<id>"
    },
    "name": "helpcenter_update_template_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesId of a script, as the draft reports it.
srcNoExternal script URL (https only). One of src / inlineBody / htmlBody.
etagNoOptimistic lock: the draft etag from your last read, or the one your last edit returned. When given, the call is refused (stale_draft) if someone changed the draft since — so you never build on a state you have not seen. Omit to apply to the current draft.
asyncNoFor src scripts: load async (default false).
deferNoFor src scripts: load deferred (default true).
indexNo0-based position in the list. Omit to append at the end.
labelNoA name for the script, e.g. 'Plausible analytics'.
pagesNoOnly run on these page kinds; null or omitted runs everywhere.
enabledNofalse keeps the script configured without running it.
site_idNoWhich help center to act on: an id from helpcenter_list_sites. Needed when this connection reaches more than one help center; omit it when it reaches one. Applies to this call only — pass it on every call of a task, and ask the user which help center they mean if their request does not say.
htmlBodyNoRaw HTML emitted verbatim — a vendor snippet, a <meta> verification tag. One of src / inlineBody / htmlBody.
positionNoWhere it is emitted: headStart, headEnd, bodyStart or bodyEnd.
integrityNoSubresource Integrity hash, e.g. 'sha384-…'.
inlineBodyNoJavaScript source, WITHOUT <script> tags. One of src / inlineBody / htmlBody.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already flag destructiveHint and idempotentHint, but the description adds materially: omitted fields retain their value (partial-update semantics), changes are draft-only and gated behind a separate publish call, the etag produces a stale_draft refusal, and a classic help center answers template_migration_required. It even warns that a published script runs for every visitor and should only be changed from a trusted source as the customer asked.

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?

Front-loaded with the core action and the draft/publish gating before any argument detail, which is the right ordering. The trailing Args block duplicates schema descriptions and could be trimmed, but it is compact and each line carries a fact the agent uses.

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 14-parameter mutation with no output schema, the description covers the missing piece by summarizing returns (what each entry did with new ids, warnings worth relaying, draft status and new etag). Draft-vs-published state, version constraint, error condition, and etag locking are all accounted for.

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 meaning beyond the schema: "Fields left out keep their value" defines partial-update semantics, and the src/inlineBody/htmlBody triple is described as a mutually exclusive kind switch rather than three independent fields. The Args list otherwise largely restates the schema.

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 ("Change one script") and enumerates exactly what can be changed: code via src/inlineBody/htmlBody, position, pages, label, loading flags, or enabled:false. This clearly separates it from helpcenter_add_template_script and helpcenter_remove_template_script, which are the neighboring script mutations.

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

Usage Guidelines5/5

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

Gives explicit when-to-use context: it edits the v2 design DRAFT that the dashboard's Template Editor opens, nothing reaches visitors until helpcenter_publish_template, and the agent should hand the customer the Template Editor link and publish only on request. It also names the prerequisite (ids from helpcenter_get_template) and the exclusion (v2 only; classic returns template_migration_required).

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources