---
name: slimwiki
description: Read, search and create pages in the user's SlimWiki wikis. Use when the user asks to find, read, summarise or add content in SlimWiki, or mentions their wiki, knowledge base or a SlimWiki page.
---

# SlimWiki

SlimWiki is a wiki for teams. This skill lets you read and search the
wikis and pages the user has access to, and create new pages.

## Pick the interface

Use the first one that is available. All three do the same things with
the same permissions.

1. **MCP tools.** If tools named `whoami`, `list_accounts`, `list_wikis`,
   `list_pages`, `search_pages`, `get_page`, `create_page`, `archive_page`
   and `restore_page` from a `slimwiki` server are available, use them.
2. **The `slimwiki` CLI.** If `slimwiki --version` works, run
   `slimwiki agent-help` once and follow what it prints. Check it is
   signed in with `slimwiki auth status`; if not, ask the user to run
   `slimwiki auth login`.
3. **The HTTP API.** If the environment variable `SLIMWIKI_API_KEY` is
   set, call `https://api.slimwiki.com/v1` with the header
   `Authorization: Bearer $SLIMWIKI_API_KEY`.

If none is available, tell the user what is missing: an MCP connection,
the CLI, or an API key created in SlimWiki under Profile → API keys. Do
not ask the user to paste a key into the conversation.

## How SlimWiki is organised

An **account** (workspace) contains **wikis**; a wiki contains **pages**
arranged in a tree. Everything is addressed by ID.

To find a page you usually go: list accounts → list wikis in the account
→ search or list pages in the wiki → get the page.

## What you can do

| Task | MCP tool | HTTP API |
|---|---|---|
| Check the connection | `whoami` | `GET /v1/me` |
| List accounts | `list_accounts` | `GET /v1/accounts` |
| List wikis in an account | `list_wikis` | `GET /v1/wikis?account_id=…` |
| List pages in a wiki | `list_pages` | `GET /v1/wikis/{wiki_id}/pages` |
| Search pages in a wiki | `search_pages` | `GET /v1/wikis/{wiki_id}/pages/search?query=…` |
| Read a page with its content | `get_page` | `GET /v1/pages/{page_id}` |
| Find a page from its URL slug or hash | (use `search_pages`) | `GET /v1/wikis/{wiki_id}/pages/lookup?slug=…` |
| Create a page | `create_page` | `POST /v1/pages` |
| Archive a page | `archive_page` | `POST /v1/pages/{page_id}/archive` |
| Restore an archived page | `restore_page` | `POST /v1/pages/{page_id}/restore` |

Lists return `{ "object": "list", "data": [...], "has_more": true|false }`.
Page lists also return `page`, `page_size` and `total`; ask for the next
page with `page=2`. Lists and search results do not include page content:
get the page to read it.

## What you cannot do

- **Change an existing page.** Content and title are set when a page is
  created. To revise a page, tell the user, or create a new page.
- **Delete a page with the MCP tools.** Archive it instead. The HTTP API
  can permanently delete an archived page (`DELETE /v1/pages/{page_id}`);
  only do that when the user has explicitly asked for permanent deletion.
- **Anything the user cannot do themselves.** You act as the user. A
  read-only key cannot create or archive pages.

## Writing page content

`content` is a JSON array of nodes, not Markdown and not HTML. Each node
has a `type` and, depending on the type, `attrs`, `content` (child
nodes), `text` and `marks`.

```json
[
  { "type": "paragraph", "content": [
    { "type": "text", "text": "Steps we follow for " },
    { "type": "text", "text": "every", "marks": [{ "type": "bold" }] },
    { "type": "text", "text": " release." }
  ]},
  { "type": "heading", "attrs": { "level": 2 },
    "content": [{ "type": "text", "text": "Before the release" }] },
  { "type": "bulletList", "content": [
    { "type": "listItem", "content": [
      { "type": "paragraph", "content": [{ "type": "text", "text": "Update the changelog" }] }
    ]}
  ]}
]
```

Block nodes: `paragraph`, `heading` (`attrs.level` 1–3), `bulletList` and
`orderedList` (containing `listItem`), `taskList` (containing `taskItem`,
`attrs.checked`), `blockquote`, `codeBlock` (`attrs.language`),
`horizontalRule`, `table` → `tableRow` → `tableHeader` / `tableCell`.

Text goes in `{ "type": "text", "text": "…" }` nodes. Formatting is a
list of `marks` on a text node: `bold`, `italic`, `underline`, `strike`,
`code`, and `link` with `attrs.href`.

Rules:

- Do not repeat the page title as a first heading; SlimWiki shows the
  title above the content.
- A list item contains blocks (normally one `paragraph`), not text.
- A table cell contains blocks (normally one `paragraph`), not text.
- To format part of a sentence, split it into several text nodes.

## When something fails

Errors look like `{ "error": { "code": "…", "message": "…" } }`.

- `unauthorized`: the key is missing, wrong, revoked or expired. Ask the
  user for a working connection; do not retry.
- `insufficient_scope`: the key is read-only. Tell the user.
- `not_found`: the ID is wrong, or the user cannot see it.
- `invalid_request`: fix the fields listed in `error.details` and retry.
- `rate_limited`: wait the number of seconds in `Retry-After`, then retry.

## Good practice

- Before creating a page, search the wiki for an existing page on the
  same subject and tell the user if you find one.
- After creating a page, give the user its title and ID.
- Confirm with the user before archiving anything they did not name.
