Skip to main content
Glama

Save global JS

fabrement-save-global-js

Write the SITE-WIDE script (front end only, deferred) for behaviour no single block owns. Either js = the COMPLETE file (replaces; "" deletes) or edits = exact-fragment replacements of the current file — prefer edits for changes. Pass expectedHash from get-global-js. Block behaviour belongs in the block's view.js. Rules: get-skill-doc {id:"global-js-contract"} — read it before the first call.

Input Schema

NameRequiredDescriptionDefault
jsNoThe COMPLETE script (replaces the current one). "" removes it. Not with `edits`.
editsNoApplied in order to one copy; all or none. `old` is an exact fragment (whitespace-insensitive fallback) that must match exactly once unless replaceAll.
expectedHashNo`hash` from get-global-js. If the file changed since, nothing is saved.

Output Schema

NameRequiredDescriptionDefault
urlNo
hashNoOf the saved file — use as expectedHash for the next save.
bytesNo
savedYes
existsYesFalse after an empty save (the file was removed).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/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 it well: it discloses that this is a write/replace operation, that js replaces the whole file and "" deletes it, that edits are exact-fragment and applied all-or-none in order to one copy, and that a stale expectedHash means nothing is saved. What gets destroyed and the transactional/atomicity semantics are all stated.

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?

Front-loaded with the core action, then the two modes, then the hash requirement, then the rule to read the contract doc. Dense and jargon-heavy, but every sentence carries distinct information; nothing is padding.

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 mutation tool with no annotations it covers the essential gaps: destructive semantics, atomicity, concurrency guard, scope boundary versus blocks, and the required prerequisite document. An output schema exists, so return values need not be described, and no other material information 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 description coverage is 100%, so the parameter-level details are already documented and the baseline is 3. The description still adds value beyond the schema by framing `js` and `edits` as a mutually exclusive either/or and stating a preference ('prefer `edits` for changes') plus the try-get-then-save hash workflow, though it repeats some schema content.

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 (write the site-wide script) and immediately bounds the scope: front end only, deferred, for behaviour no single block owns. It explicitly carves out what does NOT belong here (block behaviour -> the block's view.js), which is enough to distinguish it from siblings like save-global-css and the block tools.

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 ('behaviour no single block owns'), when-not ('block behaviour belongs in the block's view.js'), an alternative for the common case ('prefer `edits` for changes'), and a required precondition (read get-skill-doc id=global-js-contract before the first call). The optimistic-concurrency step is tied to the sibling that produces the value (get-global-js).

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