Create Artifact
artifact-createCreate a NEW artifact in Agent Grid; never edits an existing one.
Two independent axes, easy to confuse: type (below) is where the files come from, and artifactType is what the artifact IS. artifactType defaults to app — a live web application that renders and runs at the returned URL as soon as it is ready, which is what every type below produces unless you say otherwise. Pass artifactType markdown for a readable document, or asset for a stored file: neither is a running app, so do not promise a live URL for them.
Generation types (p2c/l2c/f2c) run ASYNCHRONOUSLY: this returns IMMEDIATELY with { status: 'generating', sessionId, artifactUrl, previewUrl, playgroundUrl } while the app is still being built. The preview link shows a live loading screen that swaps in the finished app. Most of the time, you need a single call to artifact-status with { sessionId, wait: true }, BEFORE you reply to the user because it blocks until the app is ready or failed, so you report a finished app rather than a promise (if it returns still 'generating', call it again). This artifact-create tool is NOT meant to be called multiple times for the same generation request. While a matching job is active, the same stable request identity may reuse that job for the team instead of creating another. The own-code types (empty/import) return immediately.
Do NOT use for: editing an existing artifact (artifact-explore + artifact-edit, or the git flow via artifact-get_git_token); rename/visibility (artifact-update_metadata); deploying live (artifact-publish).
type: Anima GENERATES (async — poll artifact-status):
p2c: text prompt (requires prompt; optional guidelines)
l2c: website (requires url)
f2c: Figma frames (requires fileKey + nodesId + X-Figma-Token header) YOU supply (ready immediately):
empty: empty git repo you push to (requires framework)
import: your code is the first commit; EXACTLY ONE of files (inline text, up to roughly 100 KB) or zipUploadId (binaries or larger)
framework: only html and react exist. Required for empty; optional for import (detected from package.json) and generation types (default html).
Returns: generation types (p2c/l2c/f2c) → { success, status: 'generating', sessionId, artifactUrl, playgroundUrl, previewUrl }; poll artifact-status for completion. Own-code types (empty/import) → sessionId, revision, artifactUrl, name, gitRemoteUrl, access, expiresAt, nextSteps (plus fileCount, skippedFiles for import), and a read-write git token in the same response — so do NOT call artifact-get_git_token after creating. playgroundUrl comes only when artifactType is app; previewUrl renders those plus markdown artifacts, while asset artifacts expose only artifactUrl. A markdown inline-files import also returns documentPreview plus documentPreviewTruncated, so the preview card can render the bounded document text without a follow-up read. revision is the first commit: pass it straight to artifact-edit as baseRevision if you edit without git. These are ready immediately (no 'generating' status): previewUrl renders the committed files right away for import, and the seed README for empty.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | REQUIRED for l2c only. Website URL to convert to code. | |
| name | No | Display name; applied by empty and import only (default "Untitled project"). p2c, l2c and f2c name the artifact from the generated content and IGNORE this. Rename any artifact afterwards via artifact-update_metadata. | |
| type | Yes | Where the code comes from. Anima GENERATES: p2c = text prompt (requires prompt); l2c = website URL (requires url); f2c = Figma frames (requires fileKey + nodesId + X-Figma-Token header). YOU supply: empty = empty git repo you push to (requires framework); import = your code as the first commit (EXACTLY ONE of files or zipUploadId). | |
| files | No | import only, inline transport: path-to-UTF-8-text map, becomes the first commit. TEXT only, up to roughly 100 KB of source; binaries or larger use zipUploadId via artifact-get_zip_upload_url. Mutually exclusive with zipUploadId. | |
| prompt | No | REQUIRED for p2c only. Text prompt describing the UI to generate. | |
| fileKey | No | REQUIRED for f2c only. Figma file key of the design; f2c also requires the X-Figma-Token header. | |
| nodesId | No | REQUIRED for f2c only. Figma node IDs of the frames to convert. | |
| styling | No | CSS strategy; generation types only, not empty or import. p2c: tailwind, css, inline_styles. l2c: tailwind, inline_styles, vanilla_css. f2c: tailwind, plain_css, css_modules, inline_styles. | tailwind |
| language | No | typescript or javascript; generation types with framework react only, ignored otherwise. l2c output is always typescript. | |
| framework | No | ONLY html and react exist. REQUIRED for empty (declare react if pushing React code). Optional for import (auto-detected from package.json) and for p2c/l2c/f2c (defaults to html). | |
| uiLibrary | No | Optional UI library; generation types with framework react only. l2c: shadcn only. f2c: mui, antd, shadcn, clean_react. Not for p2c. | |
| guidelines | No | Optional, p2c only. Guidelines to steer generation (conventions, structure, libraries). | |
| workspaceId | No | Where to create it — an id from workspace-list_workspaces. Optional when you can create in only one workspace; otherwise required, since there is no default workspace. | |
| zipUploadId | No | import only: id from artifact-get_zip_upload_url, used AFTER HTTP PUTting the zip to its uploadUrl; for binaries or over roughly 100 KB of source. Single-use; valid within 30 minutes of the last upload. Mutually exclusive with files. | |
| artifactType | No | What the artifact IS, which decides how a human sees it. app (the default) = a running web page and needs an index.html among your files. markdown = a readable document and needs at least one .md file and no framework. Sending .md files as an app makes an artifact with nothing to render. asset = a stored image or video file; it can ONLY be created from a zipUploadId reserved with purpose "asset" via artifact-get_zip_upload_url — never from files. |