Skip to main content
Glama
getcustomaise

customaise

Official

export_script

Destructive

Exports a local script file into Customaise after validating syntax, AST, and security. Returns fix diagnostics if invalid, or updates an existing script via scriptId.

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` regardless. 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.7/5.0
Behavior5/5

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

The description substantially expands on annotations by disclosing the sanitization pipeline, non-idempotent creation vs update, stale-edit rejection, 90-second deadline, possible unknown outcome on timeout, and inability to recall committed storage writes. This is strong behavioral context beyond the structured annotations.

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?

The description is long, but the tool is complex: it has validation rules, shared-script restrictions, timeout behavior, and different UserScript/AgentScript requirements. It is front-loaded with the core action and each subsequent paragraph addresses a specific necessary caveat without repetition.

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?

Given no output schema, the description covers what the agent needs: success path, diagnostics on invalid input, operation ID and stage, timeout ambiguity, follow-up via get_bridge_status, and script-type format constraints. Nothing critical for selecting and invoking this tool 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 baseline is 3. The description adds context for scriptId and expectedCodeHash ('update existing ... reject stale edits'), but these largely mirror the schema text rather than provide new per-parameter semantics.

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?

The description states a specific action: 'Export a script from a local file into Customaise', then details validation, install, and update behavior. It also contrasts with related flows by referencing import_script for forking, so an agent can distinguish export_script from its siblings.

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?

It explicitly tells when to use this tool and when to take a different path: shared/subscribed scripts are read-only, so the agent must first call import_script with fork:true before exporting to the copy. It also directs timeout recovery to get_bridge_status with scriptId/operationId, giving clear decision rules.

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