Create path
create_pathCreate a path element from an SVG d data string, with optional fill and stroke styling. Use this tool for freeform, bezier, or curve geometry that cannot be represented by basic shapes.
Instructions
Create a <path> with the validated d data string.
When to use: freeform / bezier / curve geometry from a d string. For simple primitives prefer
create_rect / create_circle / create_polygon; to edit an existing path's geometry use the
paths tools (simplify_path, combine_paths, ...).
Key params: d validated against a strict charset (digits, whitespace, ,, ., sign,
exponent, SVG path command letters only) and length-bounded; geometry is NOT fully parsed; into
parent_id (must exist) or the document default parent. Optional fill / stroke /
stroke_width paint it in this call (validated like set_fill / set_stroke;
default None = unpainted).
Return shape: CreateResult — object_id (new id), bbox=None (paths are not analytically
measured), plus the pipeline fields (operation_id, snapshot_id, changed, preview).
Example: create_path(doc_id, "M0 0 L100 0 L50 80 Z", fill="#222")
Render and look before you trust this edit: render with render_preview (or live_render_view)
and inspect the result before relying on it; restore_snapshot reverts it if it is wrong.
Risk class: medium (reversible write-new on the working copy; original untouched).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| d | Yes | ||
| fill | No | ||
| doc_id | Yes | ||
| stroke | No | ||
| object_id | No | ||
| parent_id | No | ||
| stroke_width | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bbox | No | ||
| doc_id | Yes | ||
| changed | Yes | ||
| summary | No | ||
| object_id | Yes | ||
| snapshot_id | Yes | ||
| operation_id | Yes | ||
| preview_after | No | ||
| preview_before | No |