Documentation Index
Fetch the complete documentation index at: https://docs.uselamina.ai/llms.txt
Use this file to discover all available pages before exploring further.
Use Hosted MCP When Your Agent Supports Remote Install
The preferred agent integration is Lamina’s hosted remote MCP server. It lets MCP clients install Lamina through OAuth, bind access to a Lamina workspace, and call the five high-level creative tools without placing an API key in every tool call. Install page:- protected resource metadata:
/.well-known/oauth-protected-resource/mcp/agent - authorization server metadata:
/.well-known/oauth-authorization-server - authorization endpoint:
/mcp/oauth/authorize - token endpoint:
/mcp/oauth/token - dynamic client registration:
/mcp/oauth/register
Use Local MCP When Your Agent Can Spawn Tools
If your agent platform only supports local stdio MCP, run the Lamina MCP server locally and let the agent call tools instead of hand-rolling HTTP requests. Today, the MCP server lives in this repository and can be started with:- explicit
--api-key LAMINA_API_KEY- saved CLI login from
~/.lamina/config.json
MCP Tool Surface
The MCP server intentionally exposes five high-level tools. This keeps agent tool selection simple while preserving the full/v1 REST API for developer integrations and power users.
lamina_create- create brand-aware content from a natural-language brieflamina_status- check a run or wait for generated assetslamina_discover- find what Lamina can make for a creative goallamina_brand- load brand memory, guidance, and winning patternslamina_batch- queue up to 10 related content creations
/v1.
Example MCP Client Configuration
For hosted remote MCP clients, add the remote server URL and complete OAuth in the client:~/.lamina/config.json.
Build Agents Around Outcomes, Not Raw APIs
Lamina apps are not single-shot utility functions. They are packaged creative workflows with asynchronous execution. Agents should usually describe the desired outcome tolamina_create instead of chaining low-level calls themselves.
An agent should treat Lamina as a system with:
- discoverable app capabilities
- brand-aware prompt and input mapping
- asynchronous execution
- polling-based result delivery through
lamina_status - typed outputs
appId or advanced inputs when a developer already knows the exact workflow contract.
Recommended Agent Flow
Create from a brief
Call
lamina_create with the user’s creative request, target platform, and modality when known.Track the run
Call
lamina_status with the returned runId. Set wait=true when the agent should block for final assets.Discover options when unsure
Call
lamina_discover when the user asks what Lamina can make, or when the agent needs workflow suggestions before creating.Load brand context when useful
Call
lamina_brand when the agent needs explicit voice, visual, guardrail, or pattern context for planning.Webhooks For REST Integrations
The MCP surface useslamina_status for result polling. If you are building a server-side integration against /v1, you can use REST webhooks instead:
- expose a public HTTPS callback URL from your integration
- start a run with
POST /v1/apps/{appId}/runs?webhook=<public_callback_url> - verify the signed callback when Lamina sends completion data
Direct REST App Runs
When using direct REST app execution instead oflamina_create, fetch app metadata unless you already have fresh metadata cached for that exact appId.
This is important because the app metadata is the source of truth for:
- parameter names
- whether fields are required
- valid
optionslabels - whether a field expects a media URL
Use Parameter Names Exactly
When callingPOST /v1/apps/{appId}/runs, inputs should be keyed by parameter name.
Example:
Handle options Carefully
For parameters of type options, send one of the labels returned by the app metadata.
If the app says the valid options are:
Prefer Webhooks In Production
For production agent integrations, always use webhooks instead of polling:- No polling loop to manage
- Results arrive immediately when ready
- Signed with ED25519 - verify authenticity
- Automatic retries if your endpoint is temporarily down
lamina_create followed by lamina_status unless your integration needs direct REST webhook control.
Webhook Payload Structure
The webhook payload matches the polling response exactly:data.executionId may also be present as a deprecated compatibility alias for data.runId. New integrations should store and compare runId.
Read Output Type Before Consuming Value
Do not assume every output is an image URL. Check:typestatusvalue
imagevideotextpending
Handle Failures Explicitly
If execution fails:- inspect top-level
errorMessage - inspect each output’s
error - avoid blindly retrying the same invalid inputs
Good Agent Behaviors
- use
lamina_createfor brief-to-result work - cache app metadata briefly, but refresh when uncertain
- use
lamina_statusfor MCP result delivery - preserve
runIdfor later retrieval - branch logic on output
type - verify webhook signatures
- surface execution failure with the returned error details
Poor Agent Behaviors
- guessing parameter names from natural language
- sending internal option IDs that were never returned by the API
- treating execution as synchronous
- resubmitting the same long-running request repeatedly because output is not immediate
- ignoring webhook signatures