execute_script
Run inline Python or a saved script revision in an isolated worker to perform Revit model edits, returning a durable receipt for every run.
Instructions
Run inline Python or an exact saved script revision in the isolated fixed worker. File and typed Revit effects follow the persistent workspace policy and return a durable receipt.
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": {
"displayName": "<displayName>"
},
"name": "execute_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | No | Saved script reference; mutually exclusive with source. An exact draft or active revision, or "latest" for the newest active revision. Retired revisions are rejected | |
| source | No | Inline Python source; mutually exclusive with script | |
| document | No | Optional model path and broker-issued document handle | |
| arguments | No | JSON arguments exposed to Python as args; saved scripts validate them against the revision's inputSchema and apply its defaults | |
| processId | No | Windows process ID of the selected Revit.exe; omit it to use the only running Revit | |
| timeoutMs | No | Worker timeout, default 30000 ms | |
| displayName | Yes | Required. One plain-language line, written for the user, saying what this run does to their files or model, e.g. "Add Level 3 at 24 ft to the tower model". Shown in the Drive-It operator window's run history and approval requests | |
| idempotencyKey | No | Replay key; completed runs return their original receipt. To resume a run that returned status pending, call again with the same idempotencyKey and the same request; a new key starts a new request that needs a new approval |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| logs | Yes | ||
| error | Yes | ||
| runId | Yes | ||
| checks | Yes | ||
| result | Yes | ||
| status | Yes | ||
| changes | Yes | ||
| session | Yes | ||
| codeHash | Yes | ||
| document | Yes | ||
| arguments | Yes | ||
| startedAt | Yes | ||
| completedAt | Yes | ||
| displayName | Yes | ||
| fingerprint | Yes | ||
| savedScript | Yes | ||
| affectedFiles | Yes | ||
| workspaceRoot | Yes | ||
| idempotencyKey | Yes | ||
| policyRequests | Yes | ||
| affectedElements | Yes | ||
| policyDecisionIds | Yes |