Skip to main content
Glama

create_smart_server_script

Create ERPNext server scripts for DocType events, APIs, or schedulers; deprecated, so use create_server_script with mode='smart' for new scripts instead.

Instructions

[DEPRECATED] Use create_server_script with mode='smart' instead – kept for backward compatibility

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_smart_server_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoScript name (optional, auto-generated if not provided)
eventNoEvent type (for DocType Event scripts)
scriptYesPython script 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 (required for DocType Event)
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

B3.1/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden. Beyond the deprecation notice it discloses nothing: not that the call creates a persistent script, not required permissions, not whether script_type/event constraints are validated, and not what is returned.

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?

A single bracketed deprecation flag followed by the replacement and its argument — front-loaded, zero waste, and impossible to misread.

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?

For an 8-parameter creation tool with no annotations and no output schema, the definition gives an agent almost nothing about runtime behavior or effects. The deprecation notice mitigates this by steering callers away, but if the tool must be invoked for compatibility an agent would be acting largely on the schema alone.

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% with 8 well-documented parameters, including enums for script_type and event, so the schema does the heavy lifting. The description adds no parameter meaning beyond that baseline, and its one parameter-adjacent hint (mode='smart') refers to the sibling tool, not this one.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description never states what the tool does; the purpose is only inferable from the name (create a smart server script) plus the note that it is the legacy form of create_server_script. It successfully conveys deprecation status, but an agent gets no explicit verb/resource statement or explanation of what 'smart' means here.

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?

It explicitly names the alternative (create_server_script with mode='smart') and states the reason this one still exists (backward compatibility), which is clear routing guidance. It omits the conditions under which calling this tool is still acceptable, but the routing intent is unambiguous.

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