Skip to main content
Glama
getcustomaise

customaise

Official

export_script

Destructive

Import a local script file into Customaise, validating syntax, AST, and security before installing it or updating an existing script by ID.

Instructions

Export a script from a local file into Customaise. The file will be validated through Customaise's sanitization pipeline (syntax checking, AST validation, security analysis). If valid, the script is installed and ready to execute on matching pages. If invalid, detailed diagnostics explain exactly what to fix. Pass scriptId to update an existing script instead of creating a new one. Pass expectedCodeHash from import_script to reject stale edits. Save progress includes an operation ID and stage. A timeout may leave the outcome unknown: query get_bridge_status with the scriptId and operationId from the error before retrying. The extension enforces a 90-second save deadline and cancels work that has not reached persistence. A storage write already submitted cannot be recalled; its commit receipt resolves that uncertainty. NOTE: You cannot overwrite a shared/subscribed script — they are read-only. If you need to edit a shared script, first call import_script with fork:true (creates an editable independent copy), then export to that copy's scriptId.

Reminder for UserScripts: Must use an IIFE with named functions for symbol-level editing, `// @namespace https://customaise.com`, and standard directives (@name, @match, @grant).
Reminder for AgentScripts: MUST use `// ==AgentScript==` block, MUST explicitly declare tools via `// @webmcp <toolName> <permission>` (e.g. `// @webmcp my_tool prompt`). Permissions: allow (autonomous), prompt (interactive), deny (blocked). Prefer `prompt`: in a script you write, `allow` resolves as `prompt` before user grants are applied; a saved Allow rule or user-enabled Full access can permit it. Must NOT use IIFEs. CAN use GM_* APIs for persistence, networking, and observability alongside `navigator.modelContext.registerTool()`.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesLocal file path containing the userscript source code
scriptIdNoID of an existing script to update. Omit to create a new script.
expectedCodeHashNoSHA-256 from import_script. Reject the save if the installed source has changed since that read.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv3.2.3
    • addedInput schema / properties / expectedCodeHash
      Added value: +{
      +  "description": "SHA-256 from import_script. Reject the save if the installed source has changed since that read.",
      +  "pattern": "^[a-f0-9]{64}$",
      +  "type": "string"
      +}
  2. First observedv3.2.0

TDQS

A4.3/5.0
Behavior5/5

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

Goes well beyond the annotations (readOnlyHint=false, destructiveHint=true, idempotentHint=false) by disclosing the validation pipeline stages, the 90-second save deadline and cancellation behavior, the fact that a submitted storage write cannot be recalled, and the read-only nature of shared scripts. These are exactly the operational and failure-mode traits an agent needs before invoking a destructive mutation.

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

Conciseness3/5

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

Purpose and failure handling are front-loaded effectively, but the entry is very long and includes extensive UserScripts/AgentScripts authoring boilerplate (IIFE rules, directive requirements, permission semantics) that is tangential to selecting or invoking this tool. The behavioral content earns its place; the template reminders dilute focus.

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, no-output-schema tool, the description covers validation behavior, success and failure outcomes, timeout recovery via get_bridge_status, idempotency/commit semantics, and the read-only-shared-script constraint. Nothing an agent needs to invoke it safely is missing.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all three parameters, including the meaning of scriptId and expectedCodeHash. The description reinforces these ('Pass scriptId to update...', 'Pass expectedCodeHash from import_script to reject stale edits') but adds little syntax or format detail beyond what the schema provides, so the baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource ('Export a script from a local file into Customaise') and immediately clarifies the effect (validated, installed, ready to execute), which disambiguates it from siblings like import_script and delete_script. The verb 'export...into' is slightly counterintuitive for what is effectively an install/import operation, but the following sentences resolve any ambiguity.

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?

Explicit routing conditions are given: pass scriptId to update vs create, pass expectedCodeHash to reject stale edits, and on timeout query get_bridge_status before retrying. It also states the when-not case clearly (shared/subscribed scripts are read-only) and names the alternative path (import_script with fork:true).

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