What Agents Should Prefer
Interactive agents should start with:https://app.uselamina.ai/mcp/agent only
for direct control or operations v2 does not expose.
Recipe 1: Plan, Approve, Execute
1
Check credits
Call
lamina_credits and surface the current balance before paid generation.2
Plan
Call
lamina_plan with the creative brief and known inputs. Planning does not dispatch
generation.3
Clarify
If
status is needs_clarification, ask every returned question and call lamina_plan again
with the clarified brief or inputs. For awaiting_approval, collect requiredInputs[] answers
for execution without changing the frozen plan.4
Approve
Show the plan’s steps, outputs, warnings, and estimated credits. Ask the user to approve both
the work and a finite maximum credit budget.
5
Execute
Call
lamina_execute with the exact planId and planFingerprint, the collected inputs,
maxCredits, and an idempotency key.6
Wait
Call
lamina_status with the returned runId and wait=true. Repeat status when the run
remains non-terminal or the wait reports timedOut: true.7
Deliver
Return completed
outputs[] URLs and their media types. Never treat queued or running as
success.Recipe 2: Clarification Without Plan Drift
There are two kinds of questions:questions[]withstatus: "needs_clarification"means the planner cannot freeze a safe plan. Ask the questions, then plan again with the answer.requiredInputs[]withstatus: "awaiting_approval"belongs to the frozen plan. Collect those values and pass them tolamina_execute; do not calllamina_planagain.
Recipe 3: Multi-Step Image and Video
Ask Lamina to stitch the workflow rather than manually copying one step’s output URL into the next:Recipe 4: Brand-Aware Planning
Call brand context first:brandProfileId in lamina_plan. Empty brand fields mean the workspace has not
configured them—never invent voice, colors, guardrails, or performance claims.
If the OAuth token lacks brand-read permission, planning continues without brand context and returns
a warning. Reauthorize if brand grounding is required.
Recipe 5: Upload a Local Asset
Request a signed upload:uploadUrl using the returned content type. Only after the upload succeeds
should the agent use assetUrl in planning or execution. The MCP tool does not upload bytes itself.
Recipe 6: Poll and Cancel Reliably
Status request:cancel_requested as a request, not as
confirmed cancellation. A not_cancellable response is also not cancelled.
Recipe 7: Use an Advanced App Directly
Use the advanced endpoint only when the user requests direct app control:inputs by the stable parameter keys returned from lamina_describe. Use only returned option
labels. The advanced lamina_create tool is a compatibility name over the same frozen planner;
legacy mode=app callers may still dispatch with lamina_run, but dynamic workflows, route
choices, and bounded execution should use the v2 plan lifecycle.
Recipe 8: SDK or REST Agent
Server-side agents that own an API key can use@uselamina/sdk or /v1. Their output contract is
the REST contract, where workflow output values are read from outputs[].value:
outputs[].value examples with v2 MCP status, which returns normalized
outputs[].url.
Smoke Test Checklist
- Install
https://app.uselamina.ai/mcp/agent/v2. - Complete OAuth and choose a workspace.
- Confirm the client lists the task-level plan/choose/execute/status lifecycle tools.
- Call
lamina_credits. - Call
lamina_planwith a simple image brief. - Resolve
questions[]orrequiredInputs[]without guessing. - Display the frozen plan and estimated cost, then obtain approval.
- Call
lamina_executewith a budget and idempotency key. - Call
lamina_statusuntil terminal. - Confirm completed outputs include usable URLs.
- Exercise
lamina_cancelon a test run where safe.
Troubleshooting
authorization_required: start OAuth from the MCP client or reinstall the hosted server.insufficient_scope: reconnect and approve the required scope.needs_clarification: ask the returned planning questions and plan again.plan_expired: build and approve a new plan.plan_fingerprint_mismatch: execute the exact stored fingerprint; do not alter it.unknown_cost_requires_approval: display the warning and request explicit permission before settingallowUnknownCost: true.- status wait timed out: call
lamina_statusagain with the same run ID. - terminal failure: surface the returned code and message; do not silently switch apps or models.