Skip to main content
Glama

HelpCenter.io for agents

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.

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.
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.
agent_keyYesThe api_key helpcenter_create_help_center returned for this help center, exactly as returned. Required on every call: this endpoint has no sign-in, so the key is how each call says which help center it acts on. It is sent to HelpCenter.io as this call's credential and nowhere else, and it is never shown again: keep it for the whole task, and never show it to the user or write it into content.
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 declare destructiveHint=true and idempotentHint=true, yet the description adds substantial context beyond them: the draft/live-preview boundary, the publish gate, the classic-help-center failure mode (template_migration_required), etag optimistic locking with a named error, and a warning that published scripts run for every visitor so code should come from a trusted source. That is exactly the behavioral detail an agent needs before mutating a template.

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 action and mutation semantics, then scope, then safety — a sensible ordering. It is dense but nearly every sentence carries information; the 'Args:' block is the weakest part since it re-enumerates parameters already documented at 100% coverage in the schema.

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 destructive mutation with no output schema, the description covers the return value ('what each entry did (new ids), warnings worth relaying, and the draft status with its new etag'), the concurrency model, and the credential/lifecycle context. Nothing an agent needs to invoke this correctly is missing.

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 two facts the schema does not state: 'Fields left out keep their value' (PATCH rather than replace semantics) and that supplying src, inlineBody or htmlBody switches the script to that kind (mutually exclusive mode switching). The Args list otherwise largely restates the schema, which keeps it from a 5.

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?

Opens with a specific verb and resource ('Change one script') and enumerates exactly what can be changed (code, position, pages, label, loading flags, enabled), which separates it cleanly from helpcenter_add_template_script and helpcenter_remove_template_script. It even names the underlying guide operation (`update_script`), so there is no ambiguity about what call this is.

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?

Explicitly states the edit lands on the design draft, that nothing reaches visitors until helpcenter_publish_template, and that publishing happens only when the customer asks — a clear when/when-not rule with the alternative named. It also gives prerequisites (v2 help centers only, ids from helpcenter_get_template, stale_draft on etag mismatch) that route the agent correctly.

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