Skip to main content
Glama

write_vscript

Writes a Left 4 Dead 2 VScript (.nut) with Squirrel-safe checks and brace validation, and can attach it to a VMF via a logic_script entity so the engine loads it from an add-on VPK.

Instructions

Writes a Left 4 Dead 2 VScript (.nut) and optionally attaches it to a map. Checks the file for the Lua habits that break Squirrel, for balanced braces, and for a load banner that makes the script's execution provable in console.log. When vmf is given, adds a logic_script entity with vscripts set to the file's base name (no extension), which is how the engine finds it inside an add-on VPK. Guarded.

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": {
      "path": "<path>",
      "content": "<content>"
    },
    "name": "write_vscript"
  }
}

Input Schema

NameRequiredDescriptionDefault
vmfNoOptional .vmf to attach the script to; adds a logic_script entity.
pathYesWhere to write the .nut, for example <campaign>/addon/scripts/vscripts/finale.nut.
confirmNo
contentYesThe Squirrel source.

Output Schema

NameRequiredDescriptionDefault
vmfYes
pathYes
bytesYes
attachedYes
entityIdYes
warningsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.24-alpha

TDQS

A4.3/5.0
Behavior4/5

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

With only a title annotation, the description carries the full burden and mostly succeeds: it discloses the validation passes (Lua-habit lint, brace balance, load-banner requirement) and the concrete side effect on the VMF (a logic_script entity with `vscripts` set to the base name). Gaps remain — it never says whether failed checks abort the write or merely warn, whether an existing file is overwritten, or what 'Guarded' actually gates (presumably the undocumented `confirm` flag).

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?

Four sentences, front-loaded with purpose and side effect, with no filler. The one-word fragment 'Guarded.' is too terse to convey information and is the only structural weak point.

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?

An output schema exists, so return values need not be explained, and the description covers the write path, validation, and VMF mutation adequately for a 4-parameter tool. The remaining holes — failure/abort semantics and the meaning of `confirm` — are the only things an agent would still need to guess.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 75%, and the description adds real meaning beyond it for `vmf`: it explains the entity type created and the base-name-without-extension convention the engine requires. It says nothing about `confirm`, which has no schema description either, leaving that parameter entirely undocumented.

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 opens with a specific verb and resource ('Writes a Left 4 Dead 2 VScript (.nut)') and immediately qualifies the optional attach-to-map behavior. No sibling tool in the list writes .nut scripts, so the agent can distinguish this from write_vmf and write_campaign without inspecting schemas.

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 clearly states the conditional path: 'When `vmf` is given, adds a logic_script entity...' which tells the agent exactly when the optional attach behavior fires. It does not name an alternative tool or state when not to use this one, and the trailing word 'Guarded' is left unexplained, so guidance is strong but not complete.

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