Skip to main content
Glama

Write a project Lua file

cmo_write_script
DestructiveIdempotent

Writes a Lua script into a cmo-lua project and adds or updates the matching event in cmo-project.json when needed, keeping all file paths inside the project directory.

Instructions

Write a .lua file inside a cmo-lua project and, if needed, add or update the matching event in cmo-project.json. Paths cannot leave the project directory.

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": {
      "directory": "<directory>",
      "file": "<file>",
      "contents": "<contents>"
    },
    "name": "cmo_write_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesRelative .lua path, for example scripts/setup.lua
contentsYesFull Lua source
directoryYesProject folder
event_nameNoEvent description. Required when this file is not already in the project.
trigger_nameNoTrigger description. Defaults to the trigger type
trigger_typeNoTrigger type used when creating a new eventScenLoaded

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=true, and readOnlyHint=false, so the safety profile is covered. The description adds genuinely new behavioral context beyond the annotations: the write also touches cmo-project.json (a second artifact), and paths are sandboxed to the project directory. It does not state that existing file contents are overwritten, which is the main remaining gap.

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 front-loaded sentence with the primary action, the conditional side effect, and the safety constraint. No redundant or filler wording.

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 mutation tool touching two files, the description covers the main action, the conditional side effect, and the path boundary, and annotations carry destructiveness/idempotency. Only overwrite semantics for an existing .lua file are left to inference.

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 the parameters are already documented, warranting the baseline 3. The description adds only the path-confinement constraint and hints that event_name/trigger_* feed event creation, without elaborating on defaults or constraints 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 (write) and resource (.lua file) scoped to a cmo-lua project, and discloses the secondary mutation of cmo-project.json. It implicitly separates itself from cmo_write_action_script by limiting scope to "project" Lua files, though it never names that sibling or contrasts behavior explicitly.

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 context is implied by "inside a cmo-lua project" and "if needed, add or update the matching event," and the schema's conditional requirement on event_name reinforces when the event path applies. However, there is no explicit when-to-use/when-not guidance and no routing to alternatives such as cmo_write_action_script for action scripts.

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