Skip to main content
Glama

write_script

Idempotent

Create or overwrite NWScript (.nss) source files in a module and compile them to catch errors. Use it to add new scripts or edit existing ones.

Instructions

Write NWScript (.nss) source code to the module and optionally compile it. Creates or overwrites the .nss file. Use for creating new scripts or editing existing ones.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "resref": "<resref>",
      "source": "<source>"
    },
    "name": "write_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
resrefYesScript resref without extension
sourceYesThe NWScript source code to write
compileNoCompile after writing (default true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.1

TDQS

A3.5/5.0
Behavior3/5

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

The description adds real behavioral context beyond the sparse idempotentHint annotation by stating the file is created or overwritten, so an agent knows existing scripts will be replaced. It does not cover compile failure behavior, validation of source, or what happens when compile is false and the caller later needs a compiled artifact.

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

Conciseness4/5

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

Three short sentences, front-loaded with the primary action before the overwrite caveat and the usage note. No filler, though it is close to the minimum needed for a mutation tool.

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 three-parameter write tool with no output schema and a single idempotent hint, the description covers purpose, overwrite semantics, and the compile toggle, which is enough for correct invocation. The remaining gap is error/return behavior on failed compilation, which is minor given there is no output schema to describe.

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 resref, source, and compile are already documented in the schema; the baseline is 3. The description's 'optionally compile it' corroborates the compile flag and 'creates or overwrites' clarifies resref reuse, but adds no syntax or format detail beyond the schema.

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?

States a specific verb and resource: writing NWScript (.nss) source into the module, with the side effect of optional compilation. It clearly separates itself from read_script_source by naming the write/overwrite action, but it does not differentiate from write_database_object or explain its relationship to the compile_script sibling.

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?

'Use for creating new scripts or editing existing ones' gives implied usage but no when-not guidance and no routing to alternatives. Given a dedicated compile_script sibling exists, it never explains when to use the compile parameter here versus calling that tool separately.

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

Deploy Server

Other Tools