file_create
Create a new versioned shared file in the caller's org.
Shared files default to private. Call file_publish to generate the
public share URL (/s/{share_token}). Each file_update creates a
new immutable version row. Pass work_id to attach it to a task
and/or project_id to attach it to a project (same shared_files
row; project attachments are kind=artifact only).
content_format='diagram' takes either diagram schema:
teamshared.diagram/v1—body: {format: mermaid, text: "..."}, rendered as Mermaid. Best for flowcharts, sequences, and ER sketches.teamshared.diagram/v2—body: {format: scene, layers: [...], nodes: [...], edges: [...]}, rendered as a layered 3D scene where each layer is a plane (infra / software / data by convention), each node sits on one layer, and edges may cross layers.kind(defaultsystem),view(layers),mode(authored) andbody.cameraare optional. Every node needsidandlayer;shapeisbox|cylinder|sphere|cone; edges are{from, to, label?, kind?}withkindone ofsync|async|data|depends. Omitx/zto get an automatic grid on the plane. Caps: 8 layers, 300 nodes, 600 edges, 256 KiB. Unknown keys are rejected.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent | No | Override agent identity | |
| title | Yes | File title | |
| content | Yes | File body: markdown, raw HTML, a diagram document JSON/YAML when content_format='diagram', or teamshared.sheet/v1 JSON/YAML when content_format='sheet' (stored as JSON) | |
| work_id | No | Attach the new file to this work item UUID | |
| project_id | No | Attach the new file to this project UUID (kind=artifact) | |
| content_format | No | 'markdown' (allowlist sanitizer), 'html' (sanitized raw HTML), 'diagram' (teamshared.diagram/v1 Mermaid or teamshared.diagram/v2 layered 3D scene, JSON/YAML), or 'sheet' (teamshared.sheet/v1 JSON/YAML; typed grid, stored as JSON) | markdown |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||