POST /v1/context
The most useful call. You say what you’re about to do (“I’m going to write to Juan about the proposal”) and it returns a short Markdown brief, ready to paste into an agent’s prompt, within the token budget you ask for. No language model is involved: it’s fast and has no per-query cost.
- Scope:
cerebro:read - Quota: 1 read
Parameters
Section titled “Parameters”| Name | Type | Required | Limits | Default |
|---|---|---|---|---|
task |
string | Yes | 1 to 2,000 characters. What you’re about to do, in natural language | |
maxTokens |
integer | No | 300 to 8,000 | 2000 |
focus |
string[] | No | Up to 10 refs that must be included |
How it’s built
Section titled “How it’s built”- First, what you ask for in
focus. - Then, the items closest to
task, with the same search assearch(by meaning and by words). Finished tasks don’t come in as close matches. - Then, the direct neighbors (connected items) of the three closest.
- For each one: its title, its ref, its parent if it has one and its text, trimmed to fit the budget. The first one
and the
focusitems get more text; neighbors get a summary. - If one of the three closest (or a
focusitem) is a project, a trip or an event, its block also carries its open tasks (Open tasks), newest first, up to 20, with their refs. One that waits for another unfinished task says so:[blocked by: …]. That way “what’s pending in X?” is answered in a single call. - A chat group comes in as
## Chat group: <name> (group:…), and its text starts with where it comes from (WhatsApp group.,Slack channel.orChat group.) and its members (Members: A, B, …), the ones who write most first. - At the end, a
## From documents, pages, notes and conversationssection with what matches well in the documents, pages, notes and conversations: up to five, with their link if they have one. It uses up to 30% of the budget.
The Markdown starts with the task, today’s date and the person’s time zone. Whatever doesn’t fit the budget is left out. Tokens are estimated as characters divided by 4.
Examples
Section titled “Examples”curl https://meemoo.tech/api/v1/context \ -H "Authorization: Bearer $MEEMOO_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "task": "Write to Juan about the pricing proposal", "maxTokens": 1200, "focus": ["notebook:9e2b5d71-4a8c-4e3f-b6d0-2c7a1f5e8b93"] }'const res = await fetch("https://meemoo.tech/api/v1/context", { method: "POST", headers: { Authorization: `Bearer ${process.env.MEEMOO_TOKEN}`, "Content-Type": "application/json", }, body: JSON.stringify({ task: "Write to Juan about the pricing proposal", maxTokens: 1200, focus: ["notebook:9e2b5d71-4a8c-4e3f-b6d0-2c7a1f5e8b93"], }),});const { markdown, items, tokens } = await res.json();const prompt = `${markdown}\n\n---\n\nNow draft the email to Juan.`;import osimport requests
res = requests.post( "https://meemoo.tech/api/v1/context", headers={"Authorization": f"Bearer {os.environ['MEEMOO_TOKEN']}"}, json={ "task": "Write to Juan about the pricing proposal", "maxTokens": 1200, "focus": ["notebook:9e2b5d71-4a8c-4e3f-b6d0-2c7a1f5e8b93"], },)data = res.json()prompt = data["markdown"] + "\n\n---\n\nNow draft the email to Juan."Response
Section titled “Response”200 OK
{ "markdown": "# meemoo context\nTask: Write to Juan about the pricing proposal\nToday: 2026-11-14 (America/Bogota)\n\n## Notebook: Volume pricing (notebook:9e2b5d71-4a8c-4e3f-b6d0-2c7a1f5e8b93)\n10% discount from 100 licenses. Acme asked for this scheme.\n\n## Task: Send proposal to Acme (task:c4a91e07-5b2d-4f63-8e1a-7d0b3f9c2e64)\nIn: Acme Web\nI promised Juan the proposal with volume pricing before Friday.\n\n## Person: Juan Pérez (person:6f1d2c3a-8b4e-4f7a-9c21-5d8e7a1b3c40)\nCTO at Acme. Prefers calls before 10 am.\n", "items": [ { "ref": "notebook:9e2b5d71-4a8c-4e3f-b6d0-2c7a1f5e8b93", "title": "Volume pricing", "why": "focus" }, { "ref": "task:c4a91e07-5b2d-4f63-8e1a-7d0b3f9c2e64", "title": "Send proposal to Acme", "why": "match" }, { "ref": "person:6f1d2c3a-8b4e-4f7a-9c21-5d8e7a1b3c40", "title": "Juan Pérez", "why": "match" } ], "tokens": 152, "tookMs": 120}The Markdown, rendered as text:
# meemoo contextTask: Write to Juan about the pricing proposalToday: 2026-11-14 (America/Bogota)
## Notebook: Volume pricing (notebook:9e2b5d71-4a8c-4e3f-b6d0-2c7a1f5e8b93)10% discount from 100 licenses. Acme asked for this scheme.
## Task: Send proposal to Acme (task:c4a91e07-5b2d-4f63-8e1a-7d0b3f9c2e64)In: Acme WebI promised Juan the proposal with volume pricing before Friday.
## Person: Juan Pérez (person:6f1d2c3a-8b4e-4f7a-9c21-5d8e7a1b3c40)CTO at Acme. Prefers calls before 10 am.| Field | Type | What it is |
|---|---|---|
markdown |
string | The context, ready for the prompt. Labels (Task:, Today:, In:, Status: done) are in English |
items |
object[] | What went in, in the same order as in the Markdown |
items[].ref, items[].title |
string | The item |
items[].why |
string | Why it went in: focus (you asked for it), match (close to the task) or neighbor (connected to a close one) |
tokens |
integer | The Markdown’s size in tokens (characters divided by 4). Never above maxTokens |
tookMs |
integer | How long it took |
If nothing in the Cerebro is close to the task, items comes back empty and the Markdown says so in one line.
Errors
Section titled “Errors”| HTTP | code |
When |
|---|---|---|
| 400 | invalid_request |
task is missing or longer than 2,000 characters, maxTokens is outside 300 to 8,000, focus isn’t a list, has more than 10 refs or a ref is malformed |
| 401 | unauthorized |
No credential, or it expired or was revoked |
| 403 | insufficient_scope |
The credential doesn’t have cerebro:read |
| 429 | rate_limited, quota_exceeded |
More than 120 per minute, or today’s reads ran out |
A well-formed focus ref that doesn’t exist or isn’t exposed by the API is not an error: it just isn’t included.
In MCP
Section titled “In MCP”It’s the get_context tool, with the same parameters. It returns only the Markdown.