Skip to main content
Glama

create_server_script

Create a new ERPNext Server Script from script code and type, using smart mode for validation or standard mode for legacy setups. Define events, API methods, and reference DocTypes as needed.

Instructions

Create a new Server Script in ERPNext (unified – use mode = 'standard' | 'smart')

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": {
      "script_type": "<script_type>",
      "script": "<script>"
    },
    "name": "create_server_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoCreation mode: 'smart' (default) or 'standard' (legacy). Smart mode performs validation.smart
nameNoScript name (optional)
eventNoEvent type (for DocType Event scripts)
scriptYesScript code
disabledNoWhether script is disabled (1/0, optional, defaults to 0)
script_typeYesScript Type (DocType Event, API, etc.)
api_method_nameNoAPI method name (for API scripts)
reference_doctypeNoReference DocType (optional)
is_system_generatedNoIs system generated (1/0, optional, defaults to 0)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations supplied, the description carries the full behavioral burden, yet it says nothing about required permissions, whether the created script is live immediately, side effects, or failure behavior. The one behavioral hint ('smart performs validation') is already in the schema's mode description, so the prose adds nothing.

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?

One front-loaded sentence with no filler; the parenthetical mode hint is placed at the end where it belongs. It is efficient, though the brevity is part of why behavioral content is missing.

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?

A nine-parameter mutation tool with zero annotations and no output schema needs the description to explain what gets created, what validation or permissions apply, and how it relates to its siblings. A single sentence leaves the agent without that context.

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 all nine parameters are already documented in the schema, including the mode enum, script_type, and the DocType/API-specific fields. The description adds no meaning beyond the schema, so the baseline of 3 applies.

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?

The description names a specific verb and resource ('Create a new Server Script in ERPNext') and signals a unified surface with a mode switch. It stops short of distinguishing itself from the sibling 'create_smart_server_script', which an agent would need in order to pick between them.

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

Usage Guidelines2/5

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

The only usage direction is 'use mode = standard | smart', which restates the schema's enum/default rather than telling the agent when to choose this tool over create_smart_server_script, create_client_script, or the lint/preview/test siblings. No prerequisites or exclusions are given.

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