Skip to main content
Glama

custom_js_update

Replaces a Salla store's entire custom JavaScript after reading the current script, with a local backup and merchant approval before saving.

Instructions

Replace the store's entire custom JavaScript. Runs on every storefront page once saved (if custom JS is enabled). Always read the current JS first and pass the full new script. The previous JS is backed up locally before saving. Show the merchant the change and get their OK before calling.

Input Schema

NameRequiredDescriptionDefault
jsYesThe complete new JavaScript.
version_idNoTheme version ID (from theme_versions_list). Defaults to 987654321.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does real work: it discloses that the script executes on every storefront page once saved, that the previous JS is backed up locally, and that merchant confirmation is required. Remaining gaps are permissions scopes and failure behavior, but this is well above the bar for an unannotated mutation tool.

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

Conciseness5/5

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

Four short sentences, each carrying distinct information (what it does, runtime effect, workflow prerequisite, confirmation gate) with the destructive nature front-loaded.

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

Completeness4/5

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

Covers the mutation, its blast radius, the backup, and the approval gate, which is what an agent needs before calling a destructive write. It stops short of describing what a failed save leaves behind or the return shape, but no output schema exists and the critical risks are stated.

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 baseline is 3; the description adds genuine meaning by clarifying that js must be the complete script, not a fragment or patch. version_id is left entirely to the schema, which is acceptable given its own description.

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 ("Replace the store's entire custom JavaScript") plus the key scope fact that it overwrites everything rather than patching. That framing alone distinguishes it from the read-only custom_js_get sibling and from custom_js_toggle.

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?

"Always read the current JS first and pass the full new script" and "Show the merchant the change and get their OK before calling" give explicit prerequisites and ordering. It doesn't name custom_js_toggle as a lighter-weight alternative for enable/disable, so the sibling routing is only partly covered.

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