Agent recipes

Three end-to-end patterns. Each lists the tool calls it makes and the shape you get back. The read examples were run against the live server; the shapes are real.

1. Morning brief

Scope: read. Start the day with a synthesized view of what's still open and what mattered recently — no writing required.

Pull open tasks:

// list_tasks { "status": "open", "limit": 50 }
{
  "tasks": [
    {
      "task_link_id": "746d…",
      "text": "Review the Friday discussion",
      "status": "todo",
      "first_seen_date": "2026-06-18",
      "completed_date": null,
      "source_page_id": "0ff2…",
      "notion_url": "https://www.notion.so/…"
    }
  ]
}

Then have the agent compose the brief: group the open tasks by age (first_seen_date) and lead with anything still hanging from days ago. For context, it can also get_page the last day or two and pull the notes lines. Deliver it in chat — the user never leaves their agent.

2. Weekly-review harvest

Scope: read. Roll up a week of pages into a review: what got done, what's still open, and the decisions worth keeping.

// 1. list_pages over the week
{ "from": "2026-06-15", "to": "2026-06-19", "limit": 7 }

// 2. get_page for each returned page_id, then read:
//    - lines where status == "done"      → what got finished
//    - lines where section == "tasks" && status == "open"  → still open
//    - lines where section == "notes"     → decisions / context
//    - lines where priority == true       → what mattered

Because task lines carry reconciled status, "done" reflects completion in Notion or the Briefing too — not just what's crossed out in ink. Summarize the done lines as accomplishments, the open tasks as carryover, and the notes as the week's context.

3. Seed from agent

Scope: seed. Turn an external trigger — an email, a meeting, a chat decision — into a task on a future page.

// create_task_seed
{
  "target_date": "2026-06-20",
  "text": "Send the launch recap to the team",
  "source_url": "https://…"
}

// → returns
{
  "task_link_id": "9d2f…",
  "block_id": "b1c4…",
  "page_id": "44a0…",
  "created": true,
  "reused_existing_task": false,
  "notion_pushed": true,
  "notion_url": "https://www.notion.so/…"
}

Three behaviors worth knowing when you seed:

  • Idempotent. Seeding the same text again reuses the existing open task (reused_existing_task: true) instead of duplicating it.
  • Pending arrival. If the target day's page already has ink, the task lands hidden and surfaces in the in-app Briefing rather than dropping onto the canvas mid-writing.
  • Notion is best-effort. When Notion is connected, the task is pushed to the Tasks DB and notion_url comes back; if not, the Penlog-side seed still persists and a later sync reconciles it.

To close the loop later, mark it done with update_task using the returned task_link_id.