Skip to main content
Glama

execute_background_script

Execute server-side JavaScript in ServiceNow using Background Scripts to run custom code, automate processes, and interact with instance data within specified application scopes.

Instructions

Execute server-side JavaScript in ServiceNow using Background Scripts. ⚠️ SANDBOX ONLY - executes arbitrary code. 🛡️ Auto-truncates large outputs. 📁 Use {{file:path}} for large scripts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYesThe server-side JavaScript code to execute (e.g., gs.print("Hello");). Maximum 50,000 characters. Supports {{file:...}} placeholders to load content from local files.
scopeYesThe application scope (e.g., "global" or specific app scope). Required.
timeout_msNoOptional timeout in milliseconds (default: 60000, range: 1000-300000)
include_htmlNoInclude HTML output in response (default: true). Set to false for text-only mode to reduce response size.
response_modeNoResponse verbosity: full (all data), minimal (essential only), compact (summarized). Default: full
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure and does so exceptionally well. It explicitly warns about the sandbox environment ('⚠️ SANDBOX ONLY - executes arbitrary code'), discloses output handling behavior ('🛡️ Auto-truncates large outputs'), and provides practical implementation guidance. This goes well beyond what the input schema provides about parameters.

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 perfectly sized and front-loaded with the core purpose. Every sentence earns its place: the first states the primary function, the second provides critical warnings, and the third offers practical implementation advice. The emoji usage enhances scannability without adding fluff.

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?

For a complex tool that executes arbitrary code with 5 parameters and no output schema, the description provides excellent context about behavior, warnings, and practical usage. The only minor gap is the lack of information about return values or error handling, which would be helpful given there's no output schema. However, the description covers the most critical aspects well.

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?

With 100% schema description coverage, the input schema already thoroughly documents all 5 parameters. The description adds some value by reinforcing the script parameter's support for file placeholders, but doesn't provide additional semantic context beyond what's already in the schema descriptions. This meets the baseline expectation when schema coverage is complete.

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 specific action ('Execute server-side JavaScript in ServiceNow using Background Scripts') and resource ('ServiceNow'), distinguishing it from sibling tools like execute_table_operation and execute_updateset_operation which likely operate on different resources. It provides a precise verb+resource combination that leaves no ambiguity about what the tool does.

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 provides clear context for when to use this tool ('Execute server-side JavaScript in ServiceNow') and includes practical guidance for handling large scripts ('Use {{file:path}} for large scripts'). However, it doesn't explicitly state when NOT to use it or directly compare it to sibling alternatives, which prevents a perfect score.

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/ClearSkye/SkyeNet-MCP-ACE'

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