edit.pink
Pink Editor docs

Sites, session and memory

Pick the site a session works on, read its foundation and the UI selection, load playbooks, keep site memory and undo changes.

API v1

Every session starts here: list_sites, then select_site, then get_skill with pink-core. The bound site is remembered for your account, so later calls need no site_id.

Each description below is the text your AI client receives for that tool, word for word. It is written for the model, which is why it reads like instructions.

list_sites

STEP 1: List the user's Pink Editor sites so the operator can pick one. Returns, per site: id, domain (the site identity), publish_url, and the caller access flags is_member, member_role, read_only. After this call, invoke select_site with the chosen id.

Parameters

No parameters.

Input schema

{
  "type": "object",
  "properties": {}
}

select_site

STEP 2: Bind the chosen site to this MCP session AND get the foundation back in the same response. Returns brand essence: {site (incl. public_base_url), audiences, goals, ctas, writable_cols, skills_registry, memory_registry, today, current_selection, access}. Foundation does NOT enumerate pages — to find pages use db_select(cm_pages, where:{...}) or graph({predicate:'inventory'}). Writing-style (editorial playbook + brand voice) is NOT in foundation — injected server-side at article generation. STEP 3: get_skill('pink-core') for the operational runbook (publishing flow, writer-notes contract, tool choice, undo, read-only rules). Site switches also use this; treat each select_site response as authoritative (any earlier site data is stale).

Parameters

ParameterTypeRequiredDescription
site_idintegeryes

Input schema

{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "integer"
    }
  },
  "required": [
    "site_id"
  ]
}

add_site

Create a brand-new Pink Editor site and immediately switch this MCP session to it (same effect as select_site). Use when the operator wants to onboard a site that is not in list_sites yet. Returns the new site_id plus its fresh foundation, so you can start working right away. The caller becomes the site owner.

Parameters

ParameterTypeRequiredDescription
domainstringyesThe site's identity — its live hostname (e.g. "example.com"). Required.
aboutstringOptional one-line description of what the site is and who it serves.

Input schema

{
  "type": "object",
  "properties": {
    "domain": {
      "type": "string",
      "description": "The site's identity — its live hostname (e.g. \"example.com\"). Required."
    },
    "about": {
      "type": "string",
      "description": "Optional one-line description of what the site is and who it serves."
    }
  },
  "required": [
    "domain"
  ]
}

get_site

Return the currently-selected site_id (or null if none chosen).

Parameters

No parameters.

Input schema

{
  "type": "object",
  "properties": {}
}

get_foundation

Re-fetch the foundation (brand essence only) for the bound site: site, audiences, goals, ctas, writable_cols, skills_registry, memory_registry, today, current_selection, access. Use mid-session to refresh after foundation edits; otherwise select_site already returns this. Pages are not enumerated here — use db_select(cm_pages) or graph for discovery. Writing-style (playbook + voice) is NOT in foundation — injected server-side at article generation. Operational rules live in the pink-core skill.

Parameters

No parameters.

Input schema

{
  "type": "object",
  "properties": {}
}

get_selection

Returns the page(s) and/or topic the user has currently selected/clicked in the Pink Editor UI, with details (keywords, pains, questions, notes) pre-joined so you can act without follow-up reads. Call this BEFORE acting whenever the user uses deictic language: "this", "these", "this page", "these pages", "the selected", "the current", "what I'm looking at", or refers to something without naming it specifically. Response: { selection, selection_elsewhere }. selection is null when nothing is selected on the bound site. selection_elsewhere is non-null when the user has a real selection on a DIFFERENT site than this session is bound to — it carries that site's id/name and the selected topic. When it is set, do NOT say "nothing is selected": tell the user what they have selected on that other site and offer to select_site to it.

Parameters

No parameters.

Input schema

{
  "type": "object",
  "properties": {}
}

get_skill

Load a named playbook for a workflow. Returns {name, description, body, source}.

Parameters

ParameterTypeRequiredDescription
namestringyes

Input schema

{
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    }
  },
  "required": [
    "name"
  ]
}

set_memory

Append a bullet to the site's memory document, or overwrite the whole document.

Memory is one markdown doc per site, surfaced verbatim in your system prompt under AVAILABLE MEMORY. There is no load-by-name — the whole doc is already in context every turn.

Shapes: { section, line } — appends "- {line}" under "## {section}" (creates section if missing). Normal path. { replace: } — overwrites the whole doc. Use only for explicit reorganization.

Conventional sections: User, Feedback, Project, Reference (or invent a new one when it fits).

Use SPARINGLY — only save what the user said should apply going FORWARD. NEVER save drafts, finished copy, page bodies, deliverables, or current-conversation state.

Rules: ONE fact per bullet. Convert relative dates to absolute. Soft 16k-char ceiling on the whole doc — long-form procedures go in a skill (save_skill), not here. Before appending, scan AVAILABLE MEMORY to avoid duplicates; if near-identical, use { replace } to edit in place.

Parameters

ParameterTypeRequiredDescription
sectionstringH2 section name (User / Feedback / Project / Reference, or fresh).
linestringBullet content. The "- " prefix is added server-side.
replacestringFull markdown body to overwrite the doc. Mutually exclusive with section+line.

Input schema

{
  "type": "object",
  "properties": {
    "section": {
      "type": "string",
      "description": "H2 section name (User / Feedback / Project / Reference, or fresh)."
    },
    "line": {
      "type": "string",
      "description": "Bullet content. The \"- \" prefix is added server-side."
    },
    "replace": {
      "type": "string",
      "description": "Full markdown body to overwrite the doc. Mutually exclusive with section+line."
    }
  }
}

undo

Undo/redo recent mutations. Scopes: last_call, last_turn, redo_last_call, redo_last_turn. Or pass call_id.

Parameters

ParameterTypeRequiredDescription
scopelast_call, last_turn, redo_last_call, redo_last_turn
call_idstring

Input schema

{
  "type": "object",
  "properties": {
    "scope": {
      "type": "string",
      "enum": [
        "last_call",
        "last_turn",
        "redo_last_call",
        "redo_last_turn"
      ]
    },
    "call_id": {
      "type": "string"
    }
  }
}

On this page