Amba

Content Libraries

Manage and schedule content delivery — daily tips, quotes, articles, and more.

Content libraries let you manage collections of content items (tips, quotes, affirmations, articles) and deliver them to users on a schedule. Great for apps that need daily content rotation.

How it works

  1. Create a content library (e.g., "Daily Motivation", "Workout Tips")
  2. Add content items to the library with text, media, categories, and tags
  3. Create a delivery schedule to control when and how items are delivered
  4. The client SDK fetches today's content or browses the full library

SDK usage

Get today's content

const todayItems = await client.content.getToday();
// Returns items scheduled for delivery today

Browse a library

const items = await client.content.getLibrary('lib_xxx', {
  category: 'fitness',
  limit: 20,
  offset: 0,
});

Get a single item

const item = await client.content.getItem('item_xxx');

Create, update, and delete items from the client

The SDK exposes write endpoints for user-owned content. The server stamps owner_app_user_id from the current session — the caller cannot set it. updateItem and deleteItem return 404 when the target item isn't owned by the current user.

// Create — body is required; title, category, tags, metadata, media_url are optional.
const todo = await client.content.createItem('lib_todos', {
  title: 'Buy milk',
  body: '',
  metadata: { completed: false },
});
 
// Update — any field you pass overwrites. `is_active: false` soft-deletes.
await client.content.updateItem(todo.id, {
  metadata: { completed: true },
});
 
// Hard delete.
await client.content.deleteItem(todo.id);

CreateContentItemInput:

interface CreateContentItemInput {
  title?: string | null;
  body: string;
  media_url?: string | null;
  category?: string | null;
  tags?: string[];
  metadata?: Record<string, unknown>;
}

UpdateContentItemInput:

interface UpdateContentItemInput {
  title?: string | null;
  body?: string;
  media_url?: string | null;
  category?: string | null;
  tags?: string[];
  metadata?: Record<string, unknown>;
  is_active?: boolean;
}

Client API reference

MethodPathDescription
GET/client/content/todayToday's scheduled content items.
GET/client/content/libraries/:id/itemsList items in a library (query: category, limit, offset).
GET/client/content/items/:idFetch a single item.
POST/client/content/libraries/:id/itemsCreate an item owned by the current user.
PATCH/client/content/items/:idUpdate an item owned by the current user.
DELETE/client/content/items/:idDelete an item owned by the current user.

Admin API reference

Libraries

MethodPathDescription
POST/admin/content/librariesCreate library
GET/admin/content/librariesList libraries with item counts

Items

MethodPathDescription
POST/admin/content/libraries/:id/itemsAdd items to library
GET/admin/content/libraries/:id/itemsList items (paginated)
PATCH/admin/content/items/:idUpdate an item
DELETE/admin/content/items/:idDelete an item
POST/admin/content/libraries/:id/bulkBulk import items

Schedules

MethodPathDescription
POST/admin/content/schedulesCreate delivery schedule
GET/admin/content/schedulesList schedules
PATCH/admin/content/schedules/:idUpdate schedule

POST /admin/content/libraries/:id/items

Body:

{
  "items": [
    {
      "title": "Stay Consistent",
      "body": "The key to progress isn't perfection — it's consistency.",
      "category": "motivation",
      "tags": ["daily", "mindset"],
      "is_premium": false
    }
  ]
}

Schedule types

TypeDescription
daily_rotationRotates through items one per day
weeklyDelivers one item per week
randomPicks a random item each delivery
sequentialDelivers items in sort order

MCP tools

ToolDescription
amba_create_content_libraryCreate a content library
amba_add_content_itemsAdd items to a library
amba_create_content_scheduleSet up a delivery schedule

Example: Daily affirmations

Agent: "Set up a daily affirmation library with 5 items"

1. amba_create_content_library({ name: "Daily Affirmations", description: "Positive affirmations delivered daily" })
2. amba_add_content_items({ library_id: "lib_xxx", items: [
     { body: "I am capable of achieving my goals." },
     { body: "Today I choose joy and gratitude." },
     { body: "I am getting stronger every day." },
     { body: "I deserve success and happiness." },
     { body: "Every day is a fresh start." }
   ]})
3. amba_create_content_schedule({ library_id: "lib_xxx", name: "Morning Affirmation", schedule_type: "daily_rotation" })

Database tables

TablePurpose
content_librariesLibrary definitions with name and description
content_itemsIndividual items with body, media, category, tags, premium flag
content_schedulesDelivery schedules with type and config
content_deliveriesDelivery log tracking which items were delivered when