Skip to main content
Glama

davinci_script_write

Write Groovy automation scripts to DaVinci project paths, auto-appending .dv.groovy and running static checks; set confirm=true to overwrite existing files.

Instructions

直接写入 Groovy 脚本内容(覆盖已有文件需要 confirm=true)。

写入后会立即做静态检查;检查不通过时文件仍会落盘,但 ok=false 并给出问题行号。

Args: script: 目标路径;无 .groovy 后缀会自动补 .dv.groovy。 content: 完整脚本源码(UTF-8,最大 512 KB)。 confirm: 覆盖已有文件时必须为 true。

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>",
      "content": "<content>"
    },
    "name": "davinci_script_write"
  }
}

Input Schema

NameRequiredDescriptionDefault
scriptYes
confirmNo
contentYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.13.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: it discloses that static checking runs immediately, that the file is still persisted even when the check fails, that the result reports ok=false with problem line numbers, and that content is capped at 512 KB in UTF-8. It stops short of describing the full success response shape or whether parent directories are created.

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?

The write semantics and the failure-mode caveat are front-loaded, followed by a compact Args block that assigns one line per parameter. No sentence is redundant.

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 with no annotations and no output schema, the description covers the critical risks: overwrite protection, non-atomic write-then-lint behavior, and error signaling via ok=false plus line numbers. Minor gaps remain around the success return value and filesystem side effects, but nothing essential to safe invocation is missing.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate, and it does: it documents all three parameters with meaning the schema lacks, including the automatic .dv.groovy suffix behavior for 'script', the UTF-8/512 KB constraint on 'content', and the mandatory 'confirm=true' condition for 'confirm'.

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 first sentence states a specific verb and resource: directly write Groovy script content, with the overwrite condition inline. It is clear what the tool does, though it never names or contrasts with the sibling davinci_script_create, so the agent must infer which one to pick.

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 implied by the 'direct write / overwrite requires confirm=true' framing and by the note that lint runs afterwards, which hints this is the raw-write path rather than a scaffolded create. However, no explicit when-to-use or when-not-to-use guidance is given, and no alternative tool is named.

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