# Graffalo → SteveCAD: explicit part properties

This is a request-preparation example, not a native integration or an assembly solver.
No file is uploaded and no CAD code is run by Graffalo. Steve's documented
[`write_design` tool](https://stevecad.studio/docs/reference/mcp-tools/designs/#write_design)
accepts a name, kind and source code; a part sets `result` to a CadQuery solid.
Read the connected Steve server's current tool schema before sending the request.

1. Read the Graffalo document using `get_document`, retaining its revision and node IDs.
2. Obtain actual dimensions from the user/source. Diagram positions and box sizes
   are CSS pixels, **not physical dimensions**. Do not infer mm from the drawing.
3. Add the following typed properties in the inspector, or through an authorized
   revision-checked `apply_operations` update. `data` patches merge keys in
   MCP updates. Preserve existing keys, including `mermaid.id`, in a full-document save.

```json
{
  "op": "update_node",
  "id": "THE_ACTUAL_NODE_ID",
  "patch": {
    "data": {
      "mermaid.id": "arm",
      "cad.primitive": "box",
      "units": "mm",
      "widthMm": 40,
      "depthMm": 10,
      "heightMm": 6,
      "material": "PLA",
      "partNumber": "0010"
    }
  }
}
```

These dimensions are illustrative. Material and part number remain descriptive;
this example does not simulate material behavior or manufacture the part. Edge
properties such as `relation: "hinge"`, `minAngleDeg: 0`, `maxAngleDeg: 90` record
intent; they do not create or verify a real joint.

4. Export JSON and prepare a request with the dependency-free
   [bridge script](/bridges/graffalo_to_steve.mjs):

```sh
node graffalo_to_steve.mjs diagram.graffalo.json THE_ACTUAL_NODE_ID > steve-request.json
```

The script accepts only an explicit `box` with numeric, positive dimensions in mm.
It generates a fixed code template; labels and metadata are never evaluated as code.
Inspect `steve-request.json`. It contains a proposed `write_design` invocation, not
an executed tool call. It creates a new part and deliberately omits an existing
`document_id` so it cannot overwrite a Steve document by accident.

5. Once the user authorizes sending this design to their connected Steve workspace,
   use its actual MCP `write_design` tool with the prepared arguments. Do not use
   Graffalo credentials for Steve. Use Steve's `generate_model`/`inspect_model` to
   validate the result before claiming it is built correctly.

No Steve API call, paid model call, manufacturing action or dependency installation
is part of this example's validation. More primitives, components, fit clearances
and assembly transforms need explicit source data and their own checked mappings.
