Skip to main content
Glama

artifacts_create

Host a self-contained HTML page at a stable, default-private, shareable URL — the Artifact experience, in-app.

Pass exactly one of:

  • html — the full page: your <body> plus any <style>/<script>. Unlike documents.create, the page is served live (JavaScript runs), so charts, interactivity, and small tools work.

  • file_id — a workspace file whose contents are already the HTML page.

  • analytics_card_ids — ids of saved analytics dashboard cards; the platform re-runs their queries and composes one designed report page (static charts, snapshot at build time). Best way to give someone a shareable analytics report.

  • slides — a presentation. Pass the slides (plus optional deck_css) and the platform serves them in its own deck player: thumbnails, arrow keys / swipe, a Present button (full screen), a link to each slide (#slide-3), and a PDF with one slide per page. Write only the slides, never a player.

Slides. Each slide is {"html": "...", "id"?: "intro", "notes"?: "...", "class"?: "dark"}. html is the CONTENT of one slide drawn on a fixed 1920×1080 px canvas (the platform wraps it in <section class="dbk-slide"> and scales it to the screen): lay it out in px for that size, about 96–128 px margins, text 28 px or more. class is added to that section, so shared looks live in deck_css (.dbk-slide.dark { background:#0F1B2D; color:#F5F6F2 }). deck_css is the deck's one stylesheet; scope rules to .dbk-slide so the player is left alone. id (letters, digits, _, -; default s1, s2…) is how artifacts.update changes one slide later; notes are speaker notes, stored but not shown. At most 200 slides. Same sandbox as any page: inline images as data: URIs, CDN fonts are missing in the PDF.

The page runs in a locked-down sandbox: a dedicated origin + a strict CSP. That means it is fully self-contained — it CANNOT call out to the network (fetch/XHR/WebSocket are blocked; the one exception is the press counter below, which the platform adds itself). Scripts, styles and fonts may load from cdnjs.cloudflare.com, cdn.jsdelivr.net/npm/, unpkg.com, cdn.tailwindcss.com and code.jquery.com (always pin an exact version, e.g. Chart.js from cdnjs), fonts also from Google Fonts; nothing else. Images must be inline data: URIs. A PDF export renders offline with JavaScript off: anything loaded from a CDN (scripts, CSS, fonts, Tailwind) is missing there, so a page meant for PDF keeps its CSS inline and draws charts as inline SVG.

Counting presses. To know what visitors press on a shared page, put data-track="<name>" on the element (a link, a button, or anything around them): <a href="https://wa.me/..." data-track="whatsapp">. Each press is recorded with its name and time and read back with artifacts.get (events). From a script, DialogBrain.count("<name>") does the same. A name is one word: letters, digits and _ . : -, up to 64 characters, no spaces; a page may use up to 100 different names. Write each name as a literal in the page (data-track="whatsapp", DialogBrain.count("whatsapp")): only names written that way are counted, one a script builds at run time is not. Nothing about the visitor is recorded, so give each person their own page when you need to know WHO pressed. Presses made inside the app's own viewer are not counted.

access_level defaults to 'private' (viewable only in-app). Set 'shared' to make the unguessable link itself the capability (anyone-with-link). You can flip this later with artifacts.set_access.

Returns {artifact_id, slug, url, app_url, version, access_level}. app_url always opens for workspace members, in the app. url is the public link and is set ONLY for a shared artifact (a private one has no public page: handed out bare, the public link answers "not available"). Republish with artifacts.update — both links stay the same.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "title": "<title>"
    },
    "name": "artifacts_create"
  }
}

Input Schema

NameRequiredDescriptionDefault
htmlNoFull self-contained HTML page. Mutually exclusive with file_id.
titleYesShort human-readable title (page <title> + gallery label).
slidesNoA presentation: a list of {html, id?, notes?, class?}, each html one 1920x1080 slide's content. Served in the platform's deck player. Mutually exclusive with html/file_id/analytics_card_ids.
faviconNoOptional emoji used as the browser-tab icon (e.g. '📊').
file_idNoWorkspace file whose contents are the HTML page. Mutually exclusive with html.
deck_cssNoWith slides: the deck's shared CSS (scope rules to .dbk-slide).
templateNoOptional data-driven template: HTML with {{placeholder}} tokens. When set, later artifacts.refresh(data={...}) re-renders the page server-side from tiny data payloads (no HTML round-trip) — ideal for a scheduled agent that refreshes live numbers. The initial html you pass should be this template already rendered with today's values.
descriptionNoOptional one-line summary for the gallery card.
access_levelNo'private' (default, in-app only) or 'shared' (anyone-with-link).private
in_workspaceNoRun this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected.
analytics_card_idsNoCompose saved analytics dashboard cards into one report page: each card's SQL re-runs through the guarded analytics engine and renders as a static chart. Data is a snapshot at build time. Mutually exclusive with html/file_id.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / deck_css
      Added value: +{
      +  "description": "With slides: the deck's shared CSS (scope rules to .dbk-slide).",
      +  "type": "string"
      +}
    • addedInput schema / properties / slides
      Added value: +{
      +  "description": "A presentation: a list of {html, id?, notes?, class?}, each html one 1920x1080 slide's content. Served in the platform's deck player. Mutually exclusive with html/file_id/analytics_card_ids.",
      +  "items": {
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  2. Changed1 schema field changed
    • addedInput schema / properties / in_workspace
      Added value: +{
      +  "description": "Run this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected.",
      +  "type": "integer"
      +}
  3. First observed

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only declare the create/mutation profile (readOnlyHint=false, destructiveHint=false, idempotentHint=false, openWorldHint=false); the description goes far beyond, disclosing the locked-down origin + CSP sandbox, the blocked network APIs and the exact CDN allowlist, the PDF-export-with-JS-off caveat, the default-private vs shared capability model, and the full return shape with the warning that url is set only for shared artifacts.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Bold headers, bulleted input modes, and the return shape front-load the decision-critical content well. It is long and the press-tracking section (data-track naming rules, 64-char and 100-name limits) is instrumental detail an agent only needs after choosing to instrument a page; it earns its place but adds bulk to an otherwise tight definition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter tool with no output schema, the definition covers input selection, authoring constraints, sandbox limits, access model, and the returned fields — nothing an agent needs to invoke it correctly is missing. Edge cases that would otherwise cause failures (CDN pinning, inline data: images, PDF offline rendering) are all called out.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, yet the description adds real meaning: mutual exclusivity among html/file_id/analytics_card_ids/slides, the exact slide object shape with 1920x1080 canvas and margin/type sizing rules, the id-character rules that artifacts.update depends on, the 200-slide cap, and how deck_css scoping works. It explains consequences of choices, not just formats.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Names a specific verb and resource ('Host a self-contained HTML page at a stable, default-private, shareable URL') and explicitly contrasts itself with documents.create ('the page is served live (JavaScript runs)') and with artifacts.update for republishing. The four mutually exclusive input modes are enumerated up front, so an agent can tell what this tool creates versus what siblings do.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit when-to-use rules for each mode: html for a live interactive page, file_id for an existing workspace file, analytics_card_ids 'Best way to give someone a shareable analytics report', slides for a deck. It also gives when-not guidance (exactly one of the four) and routes later actions to artifacts.set_access for flipping visibility and artifacts.update for republishing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.