Skip to main content
Glama

create_client_script

Create a new ERPNext Client Script for a target DocType using standard or smart mode, with smart mode validating the script before creation.

Instructions

Create a new Client 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": "<script>",
      "dt": "<dt>"
    },
    "name": "create_client_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
dtYesTarget DocType
modeNoCreation mode: 'smart' (default) or 'standard' (legacy). Smart mode performs validation.smart
nameNoScript name (optional)
viewNoView (Form/List, optional)
scriptYesScript code
enabledNoEnabled (1/0, optional)
script_typeNoScript type (optional)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden, yet it only notes that smart mode 'performs validation' — a fact already in the schema. It does not disclose permission requirements, whether an existing script with the same name is overwritten or rejected, what happens to unspecified fields, or what the call returns.

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?

A single front-loaded sentence with the resource named first and the mode hint trailing it; nothing is padded. The phrase 'unified – use mode = ...' is slightly cryptic without knowing what is being unified.

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?

This is a 7-parameter mutation tool with no annotations and no output schema, so the description must supply safety and behavior context. One line mentioning a mode flag is not enough: the validation semantics of smart mode, failure behavior, and side effects on the target DocType are all left unexplained.

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%, including the mode enum, defaults, and optional flags, so the schema already does the explanatory work. The description only restates the mode values and adds no format, default, or constraint detail beyond it. Baseline 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?

States a specific verb and resource: creates a new Client Script in ERPNext. The parenthetical clarifies it is a unified entry point covering both 'standard' and 'smart' modes. It stops short of naming the sibling split tools (create_smart_client_script) it presumably supersedes, so the differentiation is implied rather than explicit.

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?

Usage is only implied: the word 'unified' suggests this tool should be preferred over the mode-specific siblings, and the mode enum hints at the standard-vs-smart choice. There is no explicit when-to-use, when-not-to-use, or statement of prerequisites such as the target DocType needing to exist.

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