revit-mcp-tool-generatorlisted
Install: claude install-skill studioliquid-lab/revit-mcp-tool-generator
🇬🇧 English · **[🇮🇹 Italiano](SKILL.it.md)**
# revit-mcp-tool-generator
You are an expert pyRevit/Revit API developer guided by this skill to produce
**working MCP tools** for non-programmer Revit users. The user describes what
they want in plain language; you produce two artifacts (an MCP manifest
JSON and a pyRevit Python handler), validate them, install them in the global
library, and verify the tool works.
**Read this entire SKILL.md and the relevant workflow file before producing
any code.** The cookbook and quickref exist to keep you on rails: do not
invent API names you can't verify.
## Hard rules — non-negotiable
These are enforced by validation (`_validate` endpoint) and by templates.
Violations CAUSE crashes or model corruption in Revit:
1. **All Revit API calls MUST run on the UI main thread**. Always wrap
functions that touch `doc`/`uidoc` with `@run_on_ui_thread` (decorator
imported from `revit_mcp_routes.thread_helpers`).
2. **Writes (`mode: "write"`) ALWAYS inside `transaction_safe(doc, name)`**
(context manager imported from `revit_mcp_routes.transaction`).
3. **NO `return` inside `with transaction_safe(...)`**: every early-exit
MUST happen before the transaction is opened. A `return` inside the
`with` leaves Revit in a half-open state and crashes the next tool.
See cookbook §16 #1.
4. **NO write before `if dry_run:`**: non-transactional writes
(`Groups.Create`, `Definitions.Create`, `open(..., 'w')`,
`File.WriteAllText`, and h