Skip to main content
Glama
sharafutdinovdi

Revit Model MCP

Execute C# Code

revit_execute_code
Destructive

Compile and run C# code against the live Revit API to automate model queries and edits with dry-run and confirmation.

Instructions

Compile and run C# against the live Revit API on the Revit thread.

Use a method body or a public static Script class with Execute(ScriptContext ctx). Auto mode owns one transaction and undo entry. transaction="none" is refused by default; use auto. Every call except dry_run first returns needsConfirmation, confirmationText (code hash, length, mode, document) and confirmToken without running the code. Show it and retry with identical arguments plus confirm_token only after explicit chat approval. dry_run needs no token.

Long actions may return status=running and jobId. Call revit_jobs(job_id=jobId) until the original action result is returned. The action may already have changed the model; do not resubmit it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
dry_runNo
documentNoCase-insensitive substring of the target open document's title or file name. Required to disambiguate when the Revit process has more than one document open; omit only when a single document is open (the active document is used). An unknown or ambiguous reference is rejected before any change.
transactionNoauto
confirm_tokenNo
response_timeout_sNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.9.1

TDQS

A4.6/5.0
Behavior5/5

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

Excellent transparency beyond the annotations: it explains the needsConfirmation/confirmToken handshake, that every non-dry_run call first returns needsConfirmation, that auto mode owns one transaction and undo entry, that transaction="none" is refused by default, and the async jobId/revit_jobs polling contract. The annotations (destructiveHint=true, idempotentHint=false) are consistent with the confirmation-gated destructive flow described.

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?

Front-loads the core purpose and then layers confirmation, transaction, and async semantics in tight, information-dense sentences. Slightly long but nearly every sentence carries behavioral weight; no filler.

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 high-risk destructive code-execution tool, the description covers the confirmation protocol, token reuse rule ('identical arguments plus confirm_token'), transaction ownership, dry_run exemption, and the async polling fallback with a warning not to resubmit. An output schema exists, so return values don't need explanation.

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 only 17%, so the description must carry weight. It covers dry_run, confirm_token, and transaction semantics in prose, and the schema itself documents the document parameter well. response_timeout_s and the code parameter's 200k length limit are not addressed in the description, leaving a minor gap.

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?

States a specific verb pair (compile and run) with a precise resource and execution context: 'C# against the live Revit API on the Revit thread.' This clearly distinguishes it from all sibling Revit tools, which are domain-specific model operations rather than arbitrary code execution.

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?

Provides explicit guidance on the method body versus public static Script class pattern, and importantly names the sibling tool revit_jobs for polling running actions. It doesn't spell out when to prefer this generic escape hatch over dedicated siblings like revit_move or revit_create_wall, but the context is otherwise clear.

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

Deploy Server

Other Tools