save_document_safe
Saves a FreeCAD document to its existing or specified .FCStd path while blocking accidental overwrites. Requires explicit overwrite permission and reports the possible artifact path if a write fails.
Instructions
Save with file_exists protection. Files are outside Undo/rollback; failed writes report possible artifact path.
Contract: explicit internal names recommended. Length mm, area mm^2, volume mm^3; field units override defaults. Errors: invalid_arguments, document_not_found, object_not_found, transaction_conflict, operation_failed, execution_timeout; transport failures are possible. Timeout is not cancellation: never blindly retry mutations. Legacy return shape preserved.
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": {
"doc_name": "<doc_name>"
},
"name": "save_document_safe"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Absolute .FCStd destination; omit to save to the document's existing path. | |
| doc_name | Yes | Explicit internal Name; no Label or active-document fallback. | |
| overwrite | No | Explicit permission to overwrite an existing file, including ordinary Save. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | ||
| error | No | ||
| status | Yes | ||
| warnings | No | ||
| references | No | ||
| contract_version | No | 1.0 |