Coview agent instructions
Coview is an agent-human collaboration canvas. It lets you design with a human using web tools like HTML.
Layout guidance:
- Acuarela supports frame, flex-frame, rectangle, text, and image nodes.
- Prefer flex-frame or normal document flow for padded groups, cards, rows, columns, navs, and repeated content. Use display:flex, flex-direction, gap, padding, align-items, and justify-content for those layouts.
- Use position:absolute only when an element must be placed on the artboard independently. Absolute left/top/right/bottom values are measured from the positioned parent's outer box, not from the parent's padding/content box.
- Do not expect parent padding to automatically offset absolute children. If a parent has padding:78px and a child has position:absolute; left:0; top:0, the child starts at the parent's outer corner. Use normal/flex flow inside the padded parent, or include the padding in the absolute coordinates yourself.
- Background layers can use position:absolute; inset:0 because they intentionally cover the whole parent.
If the page URL contains an id, that id is the document id to use. For example, in https://coview.dev/d/my-document-id, use documentId "my-document-id".
Agent access options:
1. Direct agent API: https://api.coview.dev/v1/agent
2. Remote MCP server: https://mcp.coview.dev/
3. Document changes API: https://api.coview.dev/v1/documents/{documentId}/changes
Direct agent API:
Use POST https://api.coview.dev/v1/agent/{method} with a JSON body matching the method input schema. Read the full method catalog at /agent-api.txt or GET https://api.coview.dev/v1/agent.
All direct agent API method URLs:
- POST https://api.coview.dev/v1/agent/get_basic_info
- POST https://api.coview.dev/v1/agent/create_document
- POST https://api.coview.dev/v1/agent/get_canvas_state
- POST https://api.coview.dev/v1/agent/apply_operations
- POST https://api.coview.dev/v1/agent/update_document_metadata
- POST https://api.coview.dev/v1/agent/finish_working_on_nodes
Example direct API call:
curl -s https://api.coview.dev/v1/agent/get_canvas_state \
-H "content-type: application/json" \
-d '{"documentId":"my-document-id"}'
Detailed documentation:
- /agent-api.txt has the complete direct API method list, schemas, and examples.
- GET https://api.coview.dev/v1/agent returns the machine-readable method catalog.
Remote MCP server:
https://mcp.coview.dev/
If your runtime supports remote MCP and does not already have callable Coview MCP tools, register or connect this remote MCP server URL before using MCP tools.
Examples for runtimes that support remote MCP:
- Claude Code: claude mcp add --transport http coview https://mcp.coview.dev/
- Generic Streamable HTTP MCP config: add a server named "coview" with url "https://mcp.coview.dev/".
- OpenAI Agents SDK: configure a hosted MCP tool with serverLabel "coview" and serverUrl "https://mcp.coview.dev/".
If the MCP endpoint returns guidance or exposes a guide tool, read that first. Then use the document id from the URL when calling tools that read or mutate the canvas.
Useful direct API flow:
1. Use create_document for a fresh canvas, or use the document id from the current Coview URL.
2. Read the current canvas with get_canvas_state.
3. Update the document title with update_document_metadata when needed.
4. Apply small operation batches with apply_operations.
5. Call finish_working_on_nodes after editing.
Document changes API:
- GET https://api.coview.dev/v1/documents/{documentId}/changes to read the current persisted store.
- POST https://api.coview.dev/v1/documents/{documentId}/changes with an operation_batch change to mutate the document.
- PATCH https://api.coview.dev/v1/documents/{documentId}/metadata to update document-level metadata such as title.
Do not infer the document from the bundled asset names in index.html. The document is identified by the URL path id and edited through one of the agent access options above.