PREFERRED for creating a diagram from a natural-language prompt — Eraser's AI picks the diagram type, generates the DSL, and renders it.
DO NOT pre-classify the user's request into a diagram type yourself. Pass `text` only (plus destination params) and LEAVE `diagramType` UNSET unless the user EXPLICITLY named a type (e.g. 'make this a sequence diagram', 'use a cloud architecture diagram'). Eraser's render service has type-specific heuristics and will pick a better type from the prompt than your guess will, especially on ambiguous asks like 'show how X works' or 'diagram the architecture'.
BEFORE calling this tool, if the user has not already specified the destination, ASK them these questions (skip any the user has already answered):
1. 'Should I create a new file for this diagram, or add it to an existing file?' — if existing, ask which fileId (or use one they just referenced).
2. If NEW file: 'Should the file be private (just for you) or shared with your team in a folder?'
3. If shared in a folder: 'Which folder?' (or offer to place it at the team root).
Do NOT call list_folders or get_folder to invent a destination yourself — ask the user. Pick destination params based on the answers:
- Existing file → pass targetFileId
- New private file → omit targetFileId, omit folderId, do NOT set isTeamFile
- New shared file at team root → omit targetFileId, omit folderId, set isTeamFile: true
- New shared file in a folder → omit targetFileId, pass folderId (this implies shared)
Returns the new diagram's id in the `diagrams[].id` field so a follow-up update_diagram/manually_update_diagram call does NOT need a list_diagrams round-trip. Prefer over manually_create_diagram unless you already have hand-written DSL/JSON.
Parameters
OPTIONAL — LEAVE THIS EMPTY by default. Only set it when the user EXPLICITLY names a diagram type (e.g. 'make this a sequence diagram', 'use a cloud architecture diagram', 'turn it into an ERD'). When omitted, Eraser's render service picks the diagram type from the prompt text using diagram-type-specific heuristics and (if applicable) the preset/template in scope — that selection is usually better than guessing from the prompt yourself. Do NOT pre-classify the user's request into a diagram type just because the value is available in your schema; spurious type-locking produces worse diagrams than letting Eraser choose, especially on ambiguous prompts ('show how X works', 'diagram the architecture'). On update_diagram, leave this empty as well — the existing diagram's type is preserved by default.
OPTIONAL — leave this empty by default. Only set it when the user EXPLICITLY names a folder to place the new file in (e.g. "put it in the Engineering folder"). Do NOT call list_folders or get_folder to "pick a sensible folder" — when omitted, the file is created at the team root and the user can move it themselves. Spurious folder discovery wastes tokens and produces unexpected file placement.
Set true only when you need a PNG URL to embed elsewhere. Not needed for in-app viewing — prefer the returned fileUrl/diagramUrl. Omitted from the response by default.
Only honored by create_diagram when a NEW file is being created (i.e. targetFileId is omitted). When true, the new file is shared with the team (non-private); when false, the new file is private to the caller. Required on plans that don't support private files. Ignored by update_diagram, and ignored on create_diagram when targetFileId is set (because no new file is created).