Create from Template
create_from_templateCreate a new CodePic diagram from a predefined template. Requires API Key authentication. Returns a public view URL and edit URL.
STRICT USAGE RULE — READ BEFORE CALLING: Only call this tool when the user has explicitly asked to use a template. Explicit signals include phrases like: "use a template", "from template", "用模板", "从模板创建", "list templates and pick one", or the user directly naming/selecting a template slug.
If the user merely describes a diagram they want (e.g. "draw an A/B test flowchart", "帮我画一个登录流程", "给我做一个系统架构图"), DO NOT call this tool. Call create_diagram instead and build the diagram from the user's description. Never silently substitute a template for a described diagram — the user will get a generic result that does not match what they asked for.
When responding to the user, present the returned URL as a clickable markdown link (e.g. [Open in CodePic →](URL)) so the user can click it directly in their AI client (Cursor / Claude / etc.).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Document name (defaults to template name) | |
| slug | Yes | Template slug (e.g. 'flowchart', 'erd', 'kanban'). Call list_templates to see all. | |
| locale | No | Language for template content (default: en) |