Skip to main content
Glama

create_client_script

Create client scripts in ServiceNow to run JavaScript on client events such as onLoad, onChange, onSubmit, or onCellEdit, automating form interactions and validations.

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)
Behavior4/5

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

Annotations already indicate non-readonly, non-destructive, non-idempotent. Description adds the crucial prerequisite (SCRIPTING_ENABLED=true) and lists script types, providing behavioral context beyond 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?

Single sentence with purpose front-loaded and prerequisite in parentheses. No unnecessary words, highly efficient.

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?

Tool has 7 params (4 required), schema covers all, no output schema. Description explains prerequisite and types but doesn't mention return value or error handling. However, as a creation tool, expected behavior is implied, leaving it slightly incomplete but still adequate.

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 parameters are well-documented. The description adds little new meaning beyond listing types already in schema, meeting baseline for high coverage.

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?

Description clearly states 'Create a new client script' with explicit script types (onLoad, onChange, onSubmit, onCellEdit), distinguishing it from other create tools. Verb and resource are specific.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Prerequisite 'requires SCRIPTING_ENABLED=true' is noted, but no guidance on when to use this vs. alternatives like create_business_rule or create_script_include. Context of when to choose client script is missing.

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/tedorigawa001/ServiceNow-MCP'

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