Skip to main content

What Agents Should Prefer

For interactive agents, prefer hosted MCP:
For server-side agents, use the SDK or REST API with LAMINA_API_KEY. Hosted MCP and REST share the same runtime model: create work, preserve runId, wait or subscribe to completion, inspect typed outputs, and reuse final artifacts explicitly.

Recipe 1: Hosted MCP Creative Run

After installing Lamina MCP in Claude Code, Codex, Cursor, or another MCP client, use this flow:
1

Create

Call lamina_create with brief, platform, and modality.
2

Clarify if needed

If the response status is needs_input, ask the user for the listed missing fields and call lamina_create again with those values in inputs.
3

Wait

Call lamina_status with runId and wait=true.
4

Reuse

Inspect each output’s type, status, and value. Reuse completed asset URLs as explicit references in the next Lamina run.
Example MCP call:
Expected started response:
Expected clarification response:

Recipe 2: TypeScript Agent With SDK

Use this for Node.js agents, backend workers, and agent runtimes that own their own API key.
Full example:

Recipe 3: Python Agent With REST

Use this when the agent is written in Python or runs in an environment without the TypeScript SDK.
Full example:

Recipe 4: Brand-Aware Planning

Agents should call brand context before generating when the user asks for brand-safe, campaign-safe, or performance-aware content.
For MCP clients, use lamina_brand before lamina_create when the agent needs explicit voice, visual, guardrail, or winning-pattern context.

Recipe 5: Artifact Reuse

Agents should not scrape provider-specific payloads. Treat completed outputs with string value fields as reusable artifact URLs.

Smoke Test Checklist

Run this checklist for every supported MCP client before broad distribution:
  1. Install https://app.uselamina.ai/mcp/agent.
  2. Complete OAuth and choose a workspace.
  3. Confirm the client lists the Lamina tools.
  4. Call lamina_discover for an image or video launch brief.
  5. Call lamina_create with a simple brief.
  6. If needs_input is returned, provide the missing input and retry.
  7. Call lamina_status with wait=true.
  8. Confirm completed outputs include typed values the agent can reuse.
  9. Remove or revoke the client after testing if it used a temporary workspace.

Troubleshooting

  • authorization_required: start OAuth from the MCP client or reinstall the hosted server.
  • insufficient_scope: reconnect and approve the requested scope.
  • needs_input: ask the user for the listed missing field; do not start a run with guessed data.
  • failed: surface errorMessage and output-level errors; do not blindly retry invalid inputs.
  • Timeout while waiting: call lamina_status again with the same runId.