SansFiction Library (Authorized)
What this skill does
- Library management (auth required): add/remove books, set reading status, log progress, view “currently reading”, and reading stats.
- Daily check-in: schedule a reminder that asks “How much did you read today?” and then logs what the user reports.
Hard rules
- Never ask for or store passwords. Use a SansFiction token only.
- Never echo the token back to the user or write it into chat logs.
- No side effects without confirmation when the target book is ambiguous (multiple matches).
Setup (one-time) — get the token
If SANSFICTION_TOKEN is missing, do this immediately:
Tell the user to open SansFiction → Connect AI Agents and use Manual Token:
Ask the user to paste the token once in this chat.
Persist it (recommended):
- In
~/.openclaw/openclaw.json:
skills.entries.sansfiction-library.apiKey: "<TOKEN>"
- (this maps to env var
SANSFICTION_TOKEN)
- Or set:
skills.entries.sansfiction-library.env.SANSFICTION_TOKEN: "<TOKEN>"
If you can’t edit config automatically, give the user the exact snippet to paste.
How to talk to SansFiction (MCP over HTTP)
Endpoint:
https://sansfiction.com/api/mcp
Use JSON-RPC with Bearer auth.
1) List available tools (discover exact tool names)
curl -s https://sansfiction.com/api/mcp \
-H "Authorization: Bearer $SANSFICTION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
2) Call a tool
Replace TOOL_NAME and ARGS with what tools/list returns.
curl -s https://sansfiction.com/api/mcp \
-H "Authorization: Bearer $SANSFICTION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"TOOL_NAME","arguments":ARGS}}'
Error handling
• If you get 401 Unauthorized, auth is missing/invalid. Ask user to regenerate token and update config.
• If tools/list is empty, verify the URL is exactly /api/mcp and auth header is present.
⸻
Library management playbook (what to do for each request)
A) Add a book to the user’s library
When user says: “add X” / “put X in my library”
1. Use MCP search tools (discover name via tools/list). Prefer search by:
• ISBN (best) → exact match
• Title + author
2. If multiple plausible matches:
• Show up to 5 options with distinguishing details (author, year, edition, pages/publisher if available).
• Ask the user to pick one.
3. Call the “add to library” tool.
4. Confirm:
• Book added
• Current status (ask if they want “to-read” vs “reading”)
B) Set reading status
When user says: “mark as reading/finished/paused/abandoned”
1. Resolve the book (same matching rules as above).
2. Call the “set status” tool with the exact status enum required by SansFiction.
• If the server rejects your status string, use the allowed values from the error/tool schema and retry.
3. Confirm the new status.
C) Log progress
When user says: “I read 20 pages” / “I’m at page 150” / “read 30 minutes”
1. Ask which book if not explicitly stated AND they have more than one active book.
2. Call the “log progress” / “update progress” tool.
• Prefer page number if provided.
• Otherwise log pages read or minutes read, whichever the tool supports.
3. Confirm what was recorded (book + new page/progress + date).
D) List currently reading
When user says: “what am I reading?” / “list currently reading”
1. Call the “list library” tool filtered to “currently reading”.
2. Return:
• Title + author
• Current progress (page/% if available)
E) Stats
When user asks: “monthly stats”, “how many books this year”
1. Call the “stats” tool(s).
2. Summarize clearly (books finished, pages/minutes, streak if available).
⸻
Daily reading reminder (cron)
Goal: once per day, ask:
“How much did you read today? Reply with: book (optional), pages or minutes, and current page if you know it.”
Turn it on
If the user asks for the reminder (or says “enable daily check-in”):
1. Schedule a cron job (timezone: Europe/Warsaw) at a reasonable default (21:00 local), unless the user specifies a time.
CLI example:
openclaw cron add \
--name "SansFiction reading check-in" \
--cron "0 21 * * *" \
--tz "Europe/Warsaw" \
--session isolated \
--message "Reading check-in: how much did you read today? Reply with pages/minutes and (optionally) which book + your current page." \
--deliver \
--channel last
What to do when the user replies
Treat their reply as a progress log:
• Parse pages/minutes and optional book/current page.
• If book is missing/ambiguous, ask one quick follow-up.
• Then log progress via MCP and confirm.
Turn it off
If the user says “disable reading reminder”:
• Remove the cron job named SansFiction reading check-in.
⸻
User-facing examples (how users can invoke this skill)
• “/sansfiction-library add Project Hail Mary”
• “/sansfiction-library mark Dune finished”
• “/sansfiction-library log Dune page 150”
• “/sansfiction-library what am I currently reading?”
• “/sansfiction-library enable daily reading reminder at 20:30”
Sources used: SansFiction MCP endpoint + token flow [oai_citation:0‡SansFiction](https://sansfiction.com/docs/agents),
OpenClaw skill frontmatter/metadata + config injection [oai_citation:1‡OpenClaw](https://docs.openclaw.ai/tools/skills),
OpenClaw cron scheduling (for the daily reminder) [oai_citation:2‡OpenClaw](https://docs.openclaw.ai/automation/cron-jobs).
1---2name: sansfiction-library3description: Authorized SansFiction library manager. Adds books to your library, updates reading status, logs progress, and can schedule a daily “how much did you read today?” check-in. Requires a SansFiction personal token (read/write).4---56# SansFiction Library (Authorized)78## What this skill does9- **Library management (auth required):** add/remove books, set reading status, log progress, view “currently reading”, and reading stats.10- **Daily check-in:** schedule a reminder that asks “How much did you read today?” and then logs what the user reports.1112## Hard rules13- **Never ask for or store passwords.** Use a SansFiction token only.14- **Never echo the token back** to the user or write it into chat logs.15- **No side effects without confirmation** when the target book is ambiguous (multiple matches).1617---1819## Setup (one-time) — get the token20If `SANSFICTION_TOKEN` is missing, do this immediately:21221) Tell the user to open **SansFiction → Connect AI Agents** and use **Manual Token**:23 - Go to: https://sansfiction.com/docs/agents24 - In **Manual Token**, click **Generate token**25 - Copy the token26272) Ask the user to paste the token **once** in this chat.28293) Persist it (recommended):30- In `~/.openclaw/openclaw.json`:31 - `skills.entries.sansfiction-library.apiKey: "<TOKEN>"`32 - (this maps to env var `SANSFICTION_TOKEN`)33- Or set:34 - `skills.entries.sansfiction-library.env.SANSFICTION_TOKEN: "<TOKEN>"`3536If you can’t edit config automatically, give the user the exact snippet to paste.3738---3940## How to talk to SansFiction (MCP over HTTP)41Endpoint:42- `https://sansfiction.com/api/mcp`4344Use JSON-RPC with Bearer auth.4546### 1) List available tools (discover exact tool names)47```bash48curl -s https://sansfiction.com/api/mcp \49 -H "Authorization: Bearer $SANSFICTION_TOKEN" \50 -H "Content-Type: application/json" \51 -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'52532) Call a tool5455Replace TOOL_NAME and ARGS with what tools/list returns.5657curl -s https://sansfiction.com/api/mcp \58 -H "Authorization: Bearer $SANSFICTION_TOKEN" \59 -H "Content-Type: application/json" \60 -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"TOOL_NAME","arguments":ARGS}}'6162Error handling63 • If you get 401 Unauthorized, auth is missing/invalid. Ask user to regenerate token and update config.64 • If tools/list is empty, verify the URL is exactly /api/mcp and auth header is present.6566⸻6768Library management playbook (what to do for each request)6970A) Add a book to the user’s library7172When user says: “add X” / “put X in my library”73 1. Use MCP search tools (discover name via tools/list). Prefer search by:74 • ISBN (best) → exact match75 • Title + author76 2. If multiple plausible matches:77 • Show up to 5 options with distinguishing details (author, year, edition, pages/publisher if available).78 • Ask the user to pick one.79 3. Call the “add to library” tool.80 4. Confirm:81 • Book added82 • Current status (ask if they want “to-read” vs “reading”)8384B) Set reading status8586When user says: “mark as reading/finished/paused/abandoned”87 1. Resolve the book (same matching rules as above).88 2. Call the “set status” tool with the exact status enum required by SansFiction.89 • If the server rejects your status string, use the allowed values from the error/tool schema and retry.90 3. Confirm the new status.9192C) Log progress9394When user says: “I read 20 pages” / “I’m at page 150” / “read 30 minutes”95 1. Ask which book if not explicitly stated AND they have more than one active book.96 2. Call the “log progress” / “update progress” tool.97 • Prefer page number if provided.98 • Otherwise log pages read or minutes read, whichever the tool supports.99 3. Confirm what was recorded (book + new page/progress + date).100101D) List currently reading102103When user says: “what am I reading?” / “list currently reading”104 1. Call the “list library” tool filtered to “currently reading”.105 2. Return:106 • Title + author107 • Current progress (page/% if available)108109E) Stats110111When user asks: “monthly stats”, “how many books this year”112 1. Call the “stats” tool(s).113 2. Summarize clearly (books finished, pages/minutes, streak if available).114115⸻116117Daily reading reminder (cron)118119Goal: once per day, ask:120121“How much did you read today? Reply with: book (optional), pages or minutes, and current page if you know it.”122123Turn it on124125If the user asks for the reminder (or says “enable daily check-in”):126 1. Schedule a cron job (timezone: Europe/Warsaw) at a reasonable default (21:00 local), unless the user specifies a time.127128CLI example:129130openclaw cron add \131 --name "SansFiction reading check-in" \132 --cron "0 21 * * *" \133 --tz "Europe/Warsaw" \134 --session isolated \135 --message "Reading check-in: how much did you read today? Reply with pages/minutes and (optionally) which book + your current page." \136 --deliver \137 --channel last138139What to do when the user replies140141Treat their reply as a progress log:142 • Parse pages/minutes and optional book/current page.143 • If book is missing/ambiguous, ask one quick follow-up.144 • Then log progress via MCP and confirm.145146Turn it off147148If the user says “disable reading reminder”:149 • Remove the cron job named SansFiction reading check-in.150151⸻152153User-facing examples (how users can invoke this skill)154 • “/sansfiction-library add Project Hail Mary”155 • “/sansfiction-library mark Dune finished”156 • “/sansfiction-library log Dune page 150”157 • “/sansfiction-library what am I currently reading?”158 • “/sansfiction-library enable daily reading reminder at 20:30”159160Sources used: SansFiction MCP endpoint + token flow [oai_citation:0‡SansFiction](https://sansfiction.com/docs/agents), 161OpenClaw skill frontmatter/metadata + config injection [oai_citation:1‡OpenClaw](https://docs.openclaw.ai/tools/skills), 162OpenClaw cron scheduling (for the daily reminder) [oai_citation:2‡OpenClaw](https://docs.openclaw.ai/automation/cron-jobs).