Skip to main content
Glama
Vectorworks MCP

Vectorworks MCP

vw_exec_python

Runs arbitrary Python inside Vectorworks when no typed tool fits, with linting and validation before execution to catch bad vs.* calls.

Instructions

Run arbitrary Python inside Vectorworks; the last resort when no typed tool fits.

Prefer the typed vw_* tools (they verify and revert precisely); give path for a script that already lives in a file, and use vw_lint to check code without running it. The code is linted first, then every vs.* call is checked inside Vectorworks (argument count and types, known crashers): a bad call comes back as VSArgumentError / VSUnsafeError in the result instead of opening the modal "Script Errors" window. Look up signatures with vw_vs_lookup.

Changes the document when the code does. Objects the code creates are revertible with vw_revert_last; changes to objects that existed before (moves, attributes, deletions) are not, and such a call blocks stepping further back. Returns {ok, value, stdout, error, traceback, created, revertable, warning?, lint_warnings?}.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "vw_exec_python"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeNoPython source to run inside Vectorworks with `vs` in scope (or give `path` instead). Python 3.9 syntax (Vectorworks 2026 embeds 3.9; no match statements, no `X | Y` types). Its stdout, the value of the last expression or of a variable named `result`, and any traceback are returned. Handles are only valid during the call: return UUIDs (vs.GetObjectUuid) to refer to objects later.
lintNoTrue (default): check the code before sending it (same as vw_lint). Syntax errors, vs.* calls with a wrong argument count, deprecated calls and functions known to crash Vectorworks or open a dialog stop the call with a report; unknown vs.* names come back as lint_warnings. False skips the check; only when the check itself is wrong.
pathNoInstead of code: path of a Python script file on this Mac ("~" is expanded), for example in the project's _claude_scripts folder. Its contents run exactly like code; give one of code and path, not both.
timeoutNoSeconds to wait for the result once Vectorworks has taken the job. Default 120; raise it for scripts that create many objects.
documentNoName of the document this must run in, as vw_list_documents shows it (".vwx" may be left out) or its full path. If another document is active, nothing changes. Omit to act on whatever document is active.
allow_dialogsNoFalse (default): vs.* functions that open a dialog are refused, because an open dialog blocks every further job until the user closes it. True: allow them on purpose.
modifies_documentNoTrue (default): the objects the code creates are recorded so vw_revert_last can delete exactly those, even if the code fails halfway. False: run as read-only code (faster, no journal entry); use it for anything that only reads.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.2.0
    • addedInput schema / properties / code / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / code / default
      Added value: +null
    • changedInput schema / properties / code / description
      Previous value: -"Python source to run inside Vectorworks with `vs` in scope. Python 3.9 syntax (Vectorworks 2026 embeds 3.9; no match statements, no `X | Y` types). Its stdout, the value of the last expression or of a variable named `result`, and any traceback are returned. Handles are only valid during the call: return UUIDs (vs.GetObjectUuid) to refer to objects later."New value: +"Python source to run inside Vectorworks with `vs` in scope (or give `path` instead). Python 3.9 syntax (Vectorworks 2026 embeds 3.9; no match statements, no `X | Y` types). Its stdout, the value of the last expression or of a variable named `result`, and any traceback are returned. Handles are only valid during the call: return UUIDs (vs.GetObjectUuid) to refer to objects later."
    • removedInput schema / properties / code / type
      Removed value: -"string"
    • addedInput schema / properties / path
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Instead of code: path of a Python script file on this Mac (\"~\" is expanded), for example in the project's _claude_scripts folder. Its contents run exactly like code; give one of code and path, not both.",
      +  "title": "Path"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "code"
      -]
  2. Changed6 schema fields changedv0.1.1
    • addedInput schema / properties / allow_dialogs / description
      Added value: +"False (default): vs.* functions that open a dialog are refused, because an open dialog blocks every further job until the user closes it. True: allow them on purpose."
    • addedInput schema / properties / code / description
      Added value: +"Python source to run inside Vectorworks with `vs` in scope. Python 3.9 syntax (Vectorworks 2026 embeds 3.9; no match statements, no `X | Y` types). Its stdout, the value of the last expression or of a variable named `result`, and any traceback are returned. Handles are only valid during the call: return UUIDs (vs.GetObjectUuid) to refer to objects later."
    • addedInput schema / properties / document / description
      Added value: +"Name of the document this must run in, as vw_list_documents shows it (\".vwx\" may be left out) or its full path. If another document is active, nothing changes. Omit to act on whatever document is active."
    • addedInput schema / properties / lint / description
      Added value: +"True (default): check the code before sending it (same as vw_lint). Syntax errors, vs.* calls with a wrong argument count, deprecated calls and functions known to crash Vectorworks or open a dialog stop the call with a report; unknown vs.* names come back as lint_warnings. False skips the check; only when the check itself is wrong."
    • addedInput schema / properties / modifies_document / description
      Added value: +"True (default): the objects the code creates are recorded so vw_revert_last can delete exactly those, even if the code fails halfway. False: run as read-only code (faster, no journal entry); use it for anything that only reads."
    • addedInput schema / properties / timeout / description
      Added value: +"Seconds to wait for the result once Vectorworks has taken the job. Default 120; raise it for scripts that create many objects."
  3. Changed4 schema fields changed
    • addedInput schema / properties / allow_dialogs
      Added value: +{
      +  "default": false,
      +  "title": "Allow Dialogs",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / document
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Document"
      +}
    • addedInput schema / properties / lint
      Added value: +{
      +  "default": true,
      +  "title": "Lint",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / timeout
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Timeout"
      +}
  4. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Goes well past the annotations: it discloses the lint-then-verify pipeline, that bad calls return VSArgumentError/VSUnsafeError instead of the modal "Script Errors" window, the exact revertibility boundary (created objects revertible via vw_revert_last; moves/attributes/deletions of pre-existing objects are not and block stepping further back), and the return keys. This is precisely the kind of consequence-level detail an agent needs before running code that mutates a live document.

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?

Front-loaded with the identity and precedence rule in the first clause, then flows to alternatives, pipeline behavior, revert semantics and return shape. Despite its length every sentence carries operational information (error types, revert boundary, return keys) rather than repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 7-parameter, no-output-schema, arbitrary-code execution tool, the description covers the critical unknowns: execution environment (vs in scope, Python 3.9), error surfacing, handle lifetime, failure modes, timeout, and post-run revert state. Nothing essential to calling it safely is missing.

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% and the schema already explains code/path exclusivity, lint defaults, timeout, document targeting, allow_dialogs and modifies_document. The description reinforces the code-vs-path choice and the default timeout of 120s, but adds little meaning beyond what the structured fields already state, so the baseline 3 applies.

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?

Names a specific verb and resource ("Run arbitrary Python inside Vectorworks") and immediately positions it in the catalogue as "the last resort when no typed tool fits", explicitly contrasting with the typed vw_* tools. An agent can tell this apart from vw_lint and the structured creators without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit alternatives and the conditions that select them: prefer typed vw_* tools because they "verify and revert precisely", use vw_lint to check without running, use vw_vs_lookup for signatures, use `path` for existing files. That is a genuine when/when-not decision tree, not implied usage.

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