Skip to main content
Glama

create_client_script

Create client-side JavaScript scripts for ServiceNow forms to automate onLoad, onChange, onSubmit, or onCellEdit events, enabling custom form behavior and validation.

Instructions

Create a new client script (onLoad, onChange, onSubmit, onCellEdit) (requires SCRIPTING_ENABLED=true)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesScript name
tableYesTable this client script applies to
typeYes"onLoad" | "onChange" | "onSubmit" | "onCellEdit"
scriptYesClient-side JavaScript. Use g_form, g_user, etc.
field_nameNoField name (required for onChange/onCellEdit)
activeNoWhether to activate the script (default: true)
globalNoRun script globally (default: false)
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While it mentions a prerequisite (SCRIPTING_ENABLED), it lacks critical details: it doesn't specify required permissions, whether the creation is reversible, potential side effects (e.g., script execution impacts), rate limits, or what the response looks like (since no output schema exists). For a mutation tool with zero annotation coverage, this is a significant gap.

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 a single, efficient sentence that front-loads the core action and includes essential prerequisite information. Every word earns its place, with no redundant or vague phrasing.

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

Completeness2/5

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

Given the complexity (a mutation tool with 7 parameters), lack of annotations, and no output schema, the description is incomplete. It covers the purpose and a prerequisite but misses behavioral details (permissions, reversibility, side effects) and return value information, which are crucial for safe and effective use.

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%, with all 7 parameters well-documented in the schema (e.g., 'type' with enum values, 'script' with usage hints). The description adds no parameter-specific information beyond what's in the schema, so it meets the baseline of 3 where the schema does the heavy lifting.

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 clearly states the verb 'Create' and the resource 'client script', specifying the four script types (onLoad, onChange, onSubmit, onCellEdit). It distinguishes this tool from sibling tools like 'create_script_include' or 'update_client_script' by focusing on client-side scripts with specific event triggers.

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?

The description explicitly states a prerequisite condition 'requires SCRIPTING_ENABLED=true', providing clear context for when to use this tool. However, it does not mention when not to use it or name specific alternatives among sibling tools (e.g., vs. create_business_rule or create_ui_action for other automation types).

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aartiq/servicenow-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server