Wren MCP

Tool reference

The server exposes 8 tools. Reads list notes and their pages, never the writing on a page; writes create notes, add pages, plan notebooks and draw figures. No tool deletes a note or changes the user’s own ink. Each section below shows the scope, parameters and a request you can send.

write_notebook_page

WriteOAuthnotes.writedestructive

Writes one handwritten study page into the user’s Wren notebook as editable ink (Wren’s handwriting, not the user’s): a worked example, concept summary, comparison sheet, process walkthrough, revision sheet, or the user’s text verbatim. With target.noteId it goes into that note; otherwise it starts a new note. The result includes noteUrl, a private link that opens the note after sign-in.

Parameters

  • titlestring (1–160)required

    Page title.

  • pageKind"worked_example" | "concept_summary" | "comparison_sheet" | "process_walkthrough" | "revision_sheet" | "verbatim"required

    The page layout. See Page kinds below.

  • blocksarray (1–24)required

    The page in order. Each block has a type: heading, paragraph, steps, equation, callout, figure, checklist or summary. Blocks can mark key terms (underline, highlight) and math (LaTeX) with exact words from the block. Unknown fields are refused.

  • subjectstring (≤120)optional

    Subject the note is filed under.

  • accent"blue" | "green" | "purple"optional

    Accent colour of a new note. An existing notebook keeps its accent.

  • targetobject { noteId, action, pageNumber }optional

    Where the page goes. Omit for a new note. noteId adds it to that note. action is "new_note" | "add_page" | "replace_page"; "replace_page" with pageNumber redraws that page, only if Wren wrote it and the user has not changed it.

  • planSlotinteger (1–30)optional

    Fills content page k of a notebook planned by plan_notebook (the cover is not a slot). Needs target.noteId.

  • noteTitlestring (1–160)optional

    Title for the note and its cover, when it should differ from the page title.

  • contextobject { subject, course, language }optional

    Subject and course are printed on the notebook cover; language (a BCP-47 tag) sets the writing direction.

Request

JSON-RPC body
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "write_notebook_page",
    "arguments": {
      "title": "Photosynthesis",
      "subject": "Biology",
      "pageKind": "concept_summary",
      "blocks": [
        {
          "type": "callout",
          "style": "definition",
          "text": "Photosynthesis is how plants turn light energy into chemical energy stored in glucose.",
          "marks": [
            {
              "text": "light energy",
              "as": "underline"
            }
          ]
        },
        {
          "type": "equation",
          "equation": "6CO_2 + 6H_2O \\rightarrow C_6H_{12}O_6 + 6O_2",
          "boxed": true
        },
        {
          "type": "heading",
          "text": "Light reactions"
        },
        {
          "type": "paragraph",
          "text": "In the thylakoids, chlorophyll absorbs light and splits water. This releases oxygen and makes ATP and NADPH.",
          "marks": [
            {
              "text": "chlorophyll",
              "as": "highlight"
            }
          ]
        },
        {
          "type": "heading",
          "text": "Calvin cycle"
        },
        {
          "type": "paragraph",
          "text": "In the stroma, the cycle uses ATP and NADPH to fix carbon dioxide. Its product is used to build glucose.",
          "marks": [
            {
              "text": "fix carbon dioxide",
              "as": "underline"
            }
          ]
        },
        {
          "type": "callout",
          "style": "key_idea",
          "text": "Light reactions capture energy; the Calvin cycle stores it in sugar."
        }
      ]
    }
  }
}

plan_notebook

WriteOAuthnotes.writedestructive

Plans a 1 to 30 page handwritten notebook and writes its cover and contents (over 8 pages: a cover page and contents pages). Each content page is a numbered slot, filled by one write_notebook_page call with target.noteId and planSlot. With noteId, the plan extends that note.

Parameters

  • titlestring (1–160)required

    Notebook title, written on the cover.

  • pagesarray (1–30) of { pageKind, title, covers, part? }required

    One entry per content page: its page kind, its title, what it covers, and an optional part that groups pages under a topic.

  • subjectstring (≤120)optional

    Subject, printed on the cover and used to file the note.

  • accent"blue" | "green" | "purple"optional

    Accent colour of the notebook.

  • noteIdstring (1–200)optional

    Extend this existing note: the new pages become the next slots after the existing ones.

  • coverFigureobject { figureKind, figureContent, title? }optional

    One on-topic sketch drawn on the cover, such as a formula or a graph.

  • contextobject { subject, course, language }optional

    Subject and course are printed on the notebook cover; language (a BCP-47 tag) sets the writing direction.

Request

JSON-RPC body
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "plan_notebook",
    "arguments": {
      "title": "The French Revolution",
      "subject": "History",
      "pages": [
        {
          "pageKind": "concept_summary",
          "title": "Causes",
          "covers": "Debt, the three estates and Enlightenment ideas"
        },
        {
          "pageKind": "process_walkthrough",
          "title": "1789",
          "covers": "From the Estates-General to the storming of the Bastille"
        },
        {
          "pageKind": "revision_sheet",
          "title": "Review",
          "covers": "Key terms, dates and people"
        }
      ]
    }
  }
}

draw_figure

WriteOAuthnotes.writedestructive

Draws one figure large on its own page: a graph, labelled diagram, chart, table, timeline, flowchart, mind map, concept map, number line or shapes. No target: a new note. target.noteId: a new page at the end of that note. With target.pageNumber it draws onto that page if Wren wrote it (mode append keeps its ink, replace redraws it). The result includes noteUrl.

Parameters

  • figureobject { kind, content }required

    What to draw. kind is one of the figure kinds below; content holds that kind’s fields.

  • titlestring (1–160)optional

    A new note’s title.

  • subjectstring (≤120)optional

    Subject a new note is filed under.

  • targetobject { noteId, pageNumber?, mode? }optional

    noteId adds a page to that note. pageNumber draws onto that page instead, only if Wren wrote it; mode is "append" (default, keeps its ink) or "replace" (redraws it).

  • contextobject { subject, course, language }optional

    Subject and course are printed on the notebook cover; language (a BCP-47 tag) sets the writing direction.

Request

JSON-RPC body
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "draw_figure",
    "arguments": {
      "title": "Quadratics",
      "subject": "Algebra",
      "figure": {
        "kind": "graph_2d",
        "content": {
          "prompt": "y = x^2 - 4"
        }
      }
    }
  }
}

list_notes

Read-onlyOAuthnotes.readidempotent

Lists notes, most recently edited first, with id, title, subject and page count.

Parameters

  • querystring (≤200)optional

    Case-insensitive match on title or subject.

  • limitinteger (1–50)optional

    Max notes to return. Default 20.

Request

JSON-RPC body
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "list_notes",
    "arguments": {
      "query": "quadratics",
      "limit": 5
    }
  }
}

list_recent_notebooks

Read-onlyOAuthnotes.readidempotent

Returns the latest notes, newest first: id, title, subject, pages, last edit, the outline of the pages Wren wrote, and the note this chat has been writing to.

Parameters

  • limitinteger (1–10)optional

    Notes per call. Default 5.

  • cursorstring (≤20)optional

    nextCursor from the previous call.

Request

JSON-RPC body
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "list_recent_notebooks",
    "arguments": {
      "limit": 5
    }
  }
}

get_note

Read-onlyOAuthnotes.readidempotent

Shows one note’s title, subject, page size and pages (number, id, stroke count, and whether Wren can add ink to the page). It does not return the writing on a page.

Parameters

  • noteIdstring (1–200)required

    Note id, from list_notes, list_recent_notebooks or a previous Wren result.

Request

JSON-RPC body
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_note",
    "arguments": {
      "noteId": "<noteId from list_notes>"
    }
  }
}

get_profile

Read-onlyOAuthprofile.readidempotent

Returns the stable account id (Firebase uid) and basic profile of the linked account.

Parameters

No parameters.

Request

JSON-RPC body
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_profile",
    "arguments": {}
  }
}

connect_account

Read-onlyOAuthprofile.readidempotent

Links the user’s Wren account so authored notes land in their notebook. Returns the linked uid.

Parameters

No parameters.

Request

JSON-RPC body
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "connect_account",
    "arguments": {}
  }
}

Page kinds

write_notebook_page takes a pageKind, and each page in a plan_notebook plan names one. A full page is about 110 to 140 words in 6 to 8 blocks, with a heading per part, 3 to 6 key terms marked, numbers and formulas marked as math, and the takeaway in a callout or summary.

  • worked_exampleWorked example

    A problem callout (box), 3 to 4 steps of 1 to 2 sentences with an equation each, a Check heading and paragraph, then common_mistake and key_answer callouts.

  • concept_summaryConcept summary

    A definition callout, a boxed equation or a table or flowchart, 2 headings with 2-sentence paragraphs, and a key_idea callout.

  • comparison_sheetComparison sheet

    A one-sentence intro, a 5 to 6 row table, a heading and paragraph on why it matters, then common_mistake and key_idea callouts side by side.

  • process_walkthroughProcess walkthrough

    An overview, 4 to 6 steps (each a stage label and 1 to 2 sentences), an optional flowchart that adds what the steps do not, and a key_idea or summary.

  • revision_sheetRevision sheet

    2 to 3 headings with short paragraphs or equations, common_mistake and remember callouts side by side, and a 4-item checklist.

  • verbatimVerbatim

    The user’s own text, unchanged and written once, in paragraph and heading blocks. Nothing is added.

Figure kinds

draw_figure takes a figure of one of these 11 kinds. A figure block inside a write_notebook_page page uses figureKind and figureContent instead; the tool schema in tools/list lists the kinds a block takes.

  • graph_2dFunction graph

    content: { prompt: "y = x^2 - 4" } (one equation) or { xRange, yRange, curves: [{ equation }] }

  • formulaTypeset formula

    content: { latex }

  • tableTable

    content: { headers, rows }

  • bar_chartBar chart

    content: { bars: [{ label, value }], title? }

  • timelineTimeline

    content: { events: [{ id, at, label }] }

  • flowchartFlowchart

    content: { nodes: [{ id, label }], edges: [{ from, to }] }

  • mindmapMind map

    content: { root: { id, label }, branches: [{ id, label, children? }] }

  • concept_mapConcept map

    content: { nodes, edges: [{ from, to, label }] }

  • labelled_diagramLabelled diagram

    content: { center, outline?, labels: [{ text, shape? }] }

  • number_lineNumber line

    content: { min, max, step?, marks?: [{ value, label? }] }

  • shapesShapes

    content: { shapes: [{ shape, x, y, w, h, label? }] } with x, y, w, h from 0 to 1

Rules that apply to writes

  • Writes are strict: an unknown field is refused with a message that names it, never silently dropped.
  • For a graph, put the equation in figure.content.prompt (for example y = x^2 - 4). Do not send polynomial coefficients.
  • Wren writes the content you send in its own handwriting. It is editable ink, not the user’s handwriting.
  • Wren only redraws or adds to pages it wrote that the user has not changed; get_note reports which pages those are. Otherwise add a new page.
  • Use replace_page (write_notebook_page) or mode: "replace" (draw_figure) only when the user asked to replace or redo the page.
  • No tool deletes a note or a page, and no tool reads the writing on a page.

Authentication details are on the Authentication page.