Skip to content

MCP tools

All MCP tools are served by the Pillbox MCP server and consumed by AI agents (Claude, Cursor, etc.). Responses are plain structured text — not JSON — so the LLM can read them directly without parsing.

Errors follow a uniform format: error: <code>, message: <description>, plus additional fields when relevant.

Pills and prescriptions belong to a bottle (project-local database). Capsules are stored in the global database (~/.pillbox/pillbox.db).


Pills are structured memory entries attached to a prescription (work session) inside a bottle.

Creates a new pill.

ParameterTypeRequiredDescription
prescription_idstring (UUID v7)yesOpen prescription to attach this pill to
titlestring (1–255)yesShort descriptive title
contentstring (1–5000)yesFull content of the pill
compoundstringyesCategory — free-text string
author_namestringyesAuthor name — see author identity
author_emailstringyesAuthor email — see author identity

Returns the id of the new pill.

Retrieves a pill by UUID.

ParameterTypeRequiredDescription
idstring (UUID v7)yesPill UUID

Returns id, prescription, created, compound, title, and full content. Returns a not_found error if the pill does not exist.

Updates a pill’s title, content, or compound.

ParameterTypeRequiredDescription
idstring (UUID v7)yesPill UUID
titlestring (1–255)noNew title
contentstring (1–5000)noNew content
compoundstringnoNew compound

Returns id, compound, and updated title.

Soft-deletes a pill (the record is marked deleted, not removed).

ParameterTypeRequiredDescription
idstring (UUID v7)yesPill UUID

Returns id and deleted_at timestamp.

Full-text search over pills using FTS5 prefix matching and Jaro-Winkler fuzzy scoring.

At least one of query or compound must be provided. If only compound is passed, lists pills of that compound without FTS filtering. If the strict pass returns zero results, the server automatically retries with fuzzy (Jaro-Winkler) expansion — the response includes used_fuzzy: true when that happened.

ParameterTypeRequiredDescription
querystringnoFTS search query — terms split on whitespace and -_/.:, joined with OR
bottle_idstring (UUID v7)noRestrict to a specific bottle
compoundstringnoFilter by compound type
limitintegernoMax results (default: 20)
fuzzybooleannoForce fuzzy (Jaro-Winkler) match from the start, skipping the strict pass. Default: false

Returns matched pills with id, compound, title, and a content snippet. Returns No pills found. when the query matches nothing.

Lists distinct pill compounds with their frequency, ordered by count descending. Useful to discover available categories before searching.

ParameterTypeRequiredDescription
bottle_idstring (UUID v7)noRestrict to a specific bottle
limitintegernoMax compounds to return

Returns a list of compound names with their pill count.


Capsules are global memory entries — conventions, workflows, and environment context shared across all projects.

Creates a new capsule in the global database.

ParameterTypeRequiredDescription
titlestring (1–255)yesShort descriptive title
contentstring (1–5000)yesFull content of the capsule
compoundstringyesCategory — free-text string

Returns the id of the new capsule.

Retrieves a capsule by UUID.

ParameterTypeRequiredDescription
idstring (UUID v7)yesCapsule UUID

Returns id, created, compound, title, and full content. Returns a not_found error if the capsule does not exist.

Updates a capsule’s title, content, or compound.

ParameterTypeRequiredDescription
idstring (UUID v7)yesCapsule UUID
titlestring (1–255)noNew title
contentstring (1–5000)noNew content
compoundstringnoNew compound

Returns id, compound, and updated title.

Soft-deletes a capsule.

ParameterTypeRequiredDescription
idstring (UUID v7)yesCapsule UUID

Returns id and deleted_at timestamp.

Full-text search over capsules using FTS5 prefix matching and Jaro-Winkler fuzzy scoring. Capsules are global — not filtered by project.

At least one of query or compound must be provided. If only compound is passed, lists capsules of that compound without FTS filtering. If the strict pass returns zero results, the server automatically retries with fuzzy (Jaro-Winkler) expansion — the response includes used_fuzzy: true when that happened.

ParameterTypeRequiredDescription
querystringnoFTS search query — terms split on whitespace and -_/.:, joined with OR
compoundstringnoFilter by compound type
limitintegernoMax results (default: 20)
fuzzybooleannoForce fuzzy (Jaro-Winkler) match from the start, skipping the strict pass. Default: false

Returns matched capsules with id, compound, title, and a content snippet. Returns No capsules found. when the query matches nothing.

Lists distinct capsule compounds with their frequency, ordered by count descending. Scope is global (all capsules across projects).

ParameterTypeRequiredDescription
limitintegernoMax compounds to return

Returns a list of compound names with their capsule count.


A prescription is an open work session inside a bottle. Pills must be attached to a prescription. Multiple prescriptions can be open per bottle at the same time.

Opens a new prescription for a bottle. To reopen a previously closed prescription, use prescription_reopen instead.

ParameterTypeRequiredDescription
bottle_idstring (UUID v7)yesBottle to open the prescription in
titlestring (1–255)yesDescriptive title for the session
author_namestringyesAuthor name — see author identity
author_emailstringyesAuthor email — see author identity

Returns id, title, and started_at. Always opens a new prescription; to reuse an existing open prescription, list open ones with bottle_context and pass its id directly.

Closes an open prescription (sets ended_at).

ParameterTypeRequiredDescription
idstring (UUID v7)yesPrescription ID

Returns id, title, started_at, and ended_at.

Reopens a closed prescription to allow editing or adding pills. Idempotent: if the prescription is already open, returns it unchanged.

ParameterTypeRequiredDescription
idstring (UUID v7)yesPrescription UUID

Returns the prescription with its current state.

Retrieves a prescription by ID.

ParameterTypeRequiredDescription
idstring (UUID v7)yesPrescription ID

Returns id, title, started_at, and ended_at. Returns a not_found error if the prescription does not exist.

Pills of a specific prescription with id, compound, title, and a 300-char snippet. Newlines in pill content are rendered as \n to keep each pill on a single visual line. Use after bottle_context to drill into a specific work session. For the full content of an individual pill, use pill_read.

ParameterTypeRequiredDescription
prescription_idstring (UUID v7)yesPrescription to inspect
limitintegernoMax pills to return (default: 30)

Returns an empty response if the prescription does not exist.

Soft-deletes a prescription and all its pills in cascade.

ParameterTypeRequiredDescription
idstring (UUID v7)yesPrescription ID

Returns a confirmation message.


A bottle represents a project — it holds a local SQLite database with all prescriptions and pills for that project.

Registers a new bottle. The directory is derived server-side from the cwd of the pillbox process (for scope='local') or from the user home (for scope='global') — agents must not pass a directory parameter.

ParameterTypeRequiredDescription
namestring (1–255)yesSlug (usually the folder name, kebab-case)
display_namestring (1–255)yesHuman-readable name
scopelocal | globalnoWhether to use a local or global database (default: local)

Returns id, name, display_name, directory, and scope.

Navigable index of a bottle’s prescriptions: id, title, status, dates, and pill count. Use at session start to discover what work sessions exist. To drill into a specific prescription’s pills, use prescription_context with its id.

ParameterTypeRequiredDescription
bottle_idstring (UUID v7)yesBottle to index
limitintegernoMax prescriptions to return (default: 30)

Lists all registered bottles. No parameters.

Returns one entry per bottle with name, scope, id, and database path. means the bottle’s database is accessible; with [unlinked] means the database file no longer exists on disk.

Registers an existing local bottle database into the calling user’s global registry. Use this when a second OS user needs to access a bottle created by another user on the same machine.

ParameterTypeRequiredDescription
directorystringnoAbsolute path to the directory containing .pillbox/pillbox.db. Defaults to the process cwd.

Returns status: "linked" on success or status: "already_linked" if the bottle was already registered. Both are exit-0 conditions. Error codes specific to this tool: db_not_found, circular_link, no_bottle_in_db.


CodeMeaning
not_foundThe requested resource does not exist
prescription_requiredThe provided prescription_id does not exist or is already closed
validation_errorOne or more input fields failed validation
invalid_inputThe input could not be parsed
internal_errorUnexpected server error
db_not_foundNo .pillbox/pillbox.db found at the target directory (bottle_vinculate)
circular_linkThe target directory is the global database directory itself (bottle_vinculate)
no_bottle_in_dbThe database file exists but contains no registered bottle (bottle_vinculate)