LegendKeeper
v0.1.2Read and build LegendKeeper worlds from AI assistants: wiki pages, maps, timelines, facts and tags.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_projects
List the LegendKeeper projects (worlds) this server is configured for, with the default project and whether writes are enabled. Each API key belongs to exactly one project.
browse_tree
Show the resource tree (the world's wiki hierarchy) as an indented outline with ids, icons, tags and child counts. Start here to see how a world is organized.
| Parameter | Type | Description |
|---|---|---|
depth | integer | How many levels to expand. |
parent | Resource id or name to list below. Omit for the top of the world. | |
project | Configured project (world) name. Omit to use the default project; see list_projects. | |
refresh | boolean | Bypass the 60-second resource cache. |
show_document_types | boolean | Show document types for resources that are not a single page. |
search
Full-text search across resource names, aliases and document content (best match first). Returns ids, paths, tags and the matching passage.
| Parameter | Type | Description |
|---|---|---|
query * | string | Words to find in names, aliases and page text. |
limit | integer | |
project | Configured project (world) name. Omit to use the default project; see list_projects. |
get_resource
Get one resource's details: path, tags, aliases, icon, banner, documents, sidebar properties (facts) and children. Use read_document to read a document's content.
| Parameter | Type | Description |
|---|---|---|
resource * | string | Resource id, or its exact name/alias (case-insensitive). |
project | Configured project (world) name. Omit to use the default project; see list_projects. |
list_tags
List every tag used in the world with how many resources carry it. Check this before tagging so you reuse existing tags with the exact same spelling.
| Parameter | Type | Description |
|---|---|---|
project | Configured project (world) name. Omit to use the default project; see list_projects. |
list_templates
List resource templates (id, name, parent). Use create_from_template to instantiate one.
| Parameter | Type | Description |
|---|---|---|
project | Configured project (world) name. Omit to use the default project; see list_projects. |
list_calendars
List the calendars timelines can use (built-in ones like gregorian, harptos, exandria, plus custom calendars): id, name, months and eras.
| Parameter | Type | Description |
|---|---|---|
project | Configured project (world) name. Omit to use the default project; see list_projects. |
list_members
List the members of the world and their roles (emails are only visible to ADMIN keys).
| Parameter | Type | Description |
|---|---|---|
project | Configured project (world) name. Omit to use the default project; see list_projects. |
list_assets
List the world's asset library (uploaded images, maps, folders) with ids and URLs. Image URLs can be used in page images, banners, map images and events.
| Parameter | Type | Description |
|---|---|---|
folder_id | Asset folder id; omit for the library root. | |
limit | integer | |
project | Configured project (world) name. Omit to use the default project; see list_projects. |
read_document
Read a document of a resource. Pages come back as Markdown (with mentions as [Name](lk://resources/id) links); maps list their pins/regions/paths with coordinates; timelines list lanes and events; boards list their text. Without `document`, the first page is used, else the first map, timeline or board.
| Parameter | Type | Description |
|---|---|---|
resource * | string | Resource id, or its exact name/alias (case-insensitive). |
document | Document id or name within the resource. Omit to pick the resource's main document. | |
format | string | markdown (default, editable), text (plain text) or json (raw API data). |
opaque_blocks | string | How page blocks Markdown cannot express are shown: 'keep' = readable summary between lk:keep markers (preserved on write), 'json' = editable ```lk-block JSON fences. |
project | Configured project (world) name. Omit to use the default project; see list_projects. |
write_page
Write Markdown to a page document. [[Name]] and [text](lk://resources/<id>) become mentions; callouts, secrets, tables, task lists and images are supported. Writes are atomic; pass expected_version (from read_document) so edits made in the app after you read the page are never overwritten.
| Parameter | Type | Description |
|---|---|---|
markdown * | string | Page content in LegendKeeper Markdown (see legendkeeper://guides/markdown). |
mode * | string | append/prepend: add to the end/start. replace: replace the whole page (keep lk:keep markers to preserve special blocks). replace_section: replace the content under the heading `section` (include the h… |
resource * | string | Resource id, or its exact name/alias (case-insensitive). |
document | Document id or name within the resource. Omit to pick the resource's main document. | |
expected_version | The page version shown by read_document. When set, nothing is written if the page changed since then. Strongly recommended with mode='replace' or 'replace_section'. | |
project | Configured project (world) name. Omit to use the default project; see list_projects. | |
section | Heading text for the *_section modes (case-insensitive). |
create_document
Add a document (tab) to a resource: a page, a map, a timeline or a board. A resource holds at most 5.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
resource * | string | Resource id, or its exact name/alias (case-insensitive). |
type * | string | page (wiki text), map, time (timeline) or board (whiteboard). |
calendar_id | For timelines: calendar id from list_calendars (e.g. 'gregorian'). | |
is_hidden | boolean | Hide the document from non-admins. |
map_image_asset_id | For maps: id of an uploaded image asset to use as the map. | |
project | Configured project (world) name. Omit to use the default project; see list_projects. |
update_document
Rename a document, hide/show it, toggle full width, set a timeline's calendar or a map's image.
| Parameter | Type | Description |
|---|---|---|
document * | string | Document id or name. |
resource * | string | Resource id, or its exact name/alias (case-insensitive). |
calendar_id | Timeline calendar id. | |
is_full_width | ||
is_hidden | ||
map_image_asset_id | Image asset id to set as the map image. | |
name | ||
project | Configured project (world) name. Omit to use the default project; see list_projects. |
delete_document
Delete one document (tab) of a resource. It can be restored with api_request (POST /resources/{id}/docs/{docId}/restore).
| Parameter | Type | Description |
|---|---|---|
document * | string | Document id or name. |
resource * | string | Resource id, or its exact name/alias (case-insensitive). |
confirm | boolean | Must be true. Ask the user before deleting. |
project | Configured project (world) name. Omit to use the default project; see list_projects. |
create_resource
Create a resource (wiki article, location, character…), optionally with page content in Markdown. Reuse existing tags (list_tags) and give it an icon. Returns the new id and its documents.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
after | Sibling (id or name) to place this one after. | |
aliases | ||
calendar_id | Calendar for a `time` document. | |
content | Markdown for the new page. [[Name]] links become mentions. | |
document_name | First document's name. | |
document_type | Type of the first document when there is no `content` (default: blank). | |
icon_color | ||
icon_glyph | Font Awesome icon name, e.g. 'dragon'. | |
icon_shape | ||
is_hidden | Create hidden (ADMIN keys only). | |
parent | Parent resource id or name. Omit (or 'root') for the top level. | |
project | Configured project (world) name. Omit to use the default project; see list_projects. | |
tags |
create_resources
Create up to 100 resources in one atomic request: ideal for scaffolding a region, a cast of NPCs or a whole hierarchy. Give items a `key` and nest later items under them with `parent_key`.
| Parameter | Type | Description |
|---|---|---|
resources * | array | 1-100 resources, created in order. |
project | Configured project (world) name. Omit to use the default project; see list_projects. |
update_resource
Change a resource's name, tags, aliases, icon, visibility, lock or banner. Content is edited with write_page; facts with set_facts; position in the tree with move_resource.
| Parameter | Type | Description |
|---|---|---|
resource * | string | Resource id, or its exact name/alias (case-insensitive). |
add_aliases | ||
add_tags | Tags to add (kept if already present). | |
aliases | Replace all aliases. | |
banner_enabled | ||
banner_url | Banner image URL (must be an uploaded asset URL, see upload_image). | |
banner_y_position | Banner focus, 0-100. | |
icon_color | ||
icon_glyph | Font Awesome icon name. | |
icon_shape | ||
is_hidden | Hide/show (ADMIN keys only). | |
is_locked | ||
name | ||
project | Configured project (world) name. Omit to use the default project; see list_projects. | |
remove_tags | Tags to remove. | |
tags | Replace all tags with this list. |
move_resource
Move a resource (and its children) to another parent and/or position among its siblings.
| Parameter | Type | Description |
|---|---|---|
resource * | string | Resource id, or its exact name/alias (case-insensitive). |
after | Place after this sibling (id or name). | |
before | Place before this sibling (id or name). | |
new_parent | New parent id or name, or 'root' for the top level. Omit to keep the parent. | |
project | Configured project (world) name. Omit to use the default project; see list_projects. |
delete_resource
Move a resource (with its documents, and children if cascade=true) to the trash. Restore it with restore_resource using the id returned here.
| Parameter | Type | Description |
|---|---|---|
resource * | string | Resource id, or its exact name/alias (case-insensitive). |
cascade | boolean | Also delete all child resources. |
confirm | boolean | Must be true. Ask the user before deleting. |
project | Configured project (world) name. Omit to use the default project; see list_projects. |
restore_resource
Restore a deleted resource from the trash (its parent must not be deleted).
| Parameter | Type | Description |
|---|---|---|
resource_id * | string | Id of the deleted resource. |
project | Configured project (world) name. Omit to use the default project; see list_projects. |
create_from_template
Create a resource from a template (copies its documents, properties, icon and tags).
| Parameter | Type | Description |
|---|---|---|
template * | string | Template id or name (see list_templates). |
include_children | boolean | Also copy the template's child resources. |
name | Name of the new resource (default: template name). | |
parent | Parent id or name; omit for top level. | |
project | Configured project (world) name. Omit to use the default project; see list_projects. |
set_facts
Set at-a-glance facts (e.g. Race, Age, Ruler, Population) as key-value rows in the page's infobox or the resource's sidebar. Creates the infobox / property group when it does not exist yet.
| Parameter | Type | Description |
|---|---|---|
facts * | object | Fact name -> value. Values accept inline Markdown and [[Name]] links. Use null to remove a fact. Existing facts with the same name (case-insensitive) are updated in place. |
resource * | string | Resource id, or its exact name/alias (case-insensitive). |
document | Document id or name within the resource. Omit to pick the resource's main document. | |
project | Configured project (world) name. Omit to use the default project; see list_projects. | |
target | string | infobox: the box at the top of the page (created if missing). sidebar: properties. |
title | Title of the key-value group (default: the first one, or 'Facts' when creating). |
create_map_feature
Add a pin, label, region, path or folder to a map document. Coordinates are [lat, lng] in the map's frame (read_document on the map shows its bounds), or image pixels with pixel_coordinates=true.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
resource * | string | Resource id, or its exact name/alias (case-insensitive). |
color | Region fill/border or path line color. | |
document | Document id or name within the resource. Omit to pick the resource's main document. | |
extra | Any other createFeature fields (labelSize, fillOpacity, strokeWidth, textColor…). | |
folder | Id of a folder feature to nest this feature in. | |
icon_color | Pin shape color (only with a shape). | |
icon_glyph | Pin icon: a Font Awesome name, e.g. 'castle'. | |
icon_shape | Shape behind a pin's glyph; default 'none' (bare glyph). | |
is_hidden | ||
link | Resource id/name (or lk:// URI) the feature opens when clicked. | |
pixel_coordinates | boolean | Treat position/points as image pixels [x, y] from the top-left corner. |
points | Vertices of a region (polygon) or a path (polyline). | |
position | Pin/label position. | |
project | Configured project (world) name. Omit to use the default project; see list_projects. | |
type | string | Feature type. |
update_map_feature
Change a map feature: rename, move, reshape, relink, restyle or hide it.
| Parameter | Type | Description |
|---|---|---|
feature_id * | string | |
resource * | string | Resource id, or its exact name/alias (case-insensitive). |
color | ||
document | Document id or name within the resource. Omit to pick the resource's main document. | |
extra | Other updateFeature fields. | |
icon_color | ||
icon_glyph | ||
icon_shape | ||
is_hidden | ||
link | Resource id/name or lk:// URI. | |
name | ||
pixel_coordinates | boolean | |
points | ||
position | ||
project | Configured project (world) name. Omit to use the default project; see list_projects. |
delete_map_feature
Delete a feature (pin, label, region, path or folder) from a map.
| Parameter | Type | Description |
|---|---|---|
feature_id * | string | |
resource * | string | Resource id, or its exact name/alias (case-insensitive). |
confirm | boolean | Must be true. |
document | Document id or name within the resource. Omit to pick the resource's main document. | |
project | Configured project (world) name. Omit to use the default project; see list_projects. |
create_timeline_event
Add an event to a timeline document. Link it to the page that tells the full story.
| Parameter | Type | Description |
|---|---|---|
name * | string | Short event name (events have no description). |
resource * | string | Resource id, or its exact name/alias (case-insensitive). |
color | ||
document | Document id or name within the resource. Omit to pick the resource's main document. | |
end | Date in the timeline's calendar, as people write it: '1492', 'Mirtul 1492', '3 March 1204', '1204-03-03'. Parsed by LegendKeeper with the document's calendar. | |
end_minutes | ||
icon_glyph | ||
is_hidden | ||
lane | Lane id or name; a new lane is created if the name does not exist. | |
link | Resource id/name (or lk:// URI) with the full story. | |
project | Configured project (world) name. Omit to use the default project; see list_projects. | |
show_on_calendar | ||
start | Date in the timeline's calendar, as people write it: '1492', 'Mirtul 1492', '3 March 1204', '1204-03-03'. Parsed by LegendKeeper with the document's calendar. | |
start_minutes | Exact start in calendar minutes (alternative to `start`). | |
type | string | 'event' or a 'note' annotation. |
update_timeline_event
Change a timeline event's name, dates, lane, link or style.
| Parameter | Type | Description |
|---|---|---|
event_id * | string | |
resource * | string | Resource id, or its exact name/alias (case-insensitive). |
color | ||
document | Document id or name within the resource. Omit to pick the resource's main document. | |
end | Date in the timeline's calendar, as people write it: '1492', 'Mirtul 1492', '3 March 1204', '1204-03-03'. Parsed by LegendKeeper with the document's calendar. | |
end_minutes | ||
icon_glyph | ||
is_hidden | ||
lane | Move to this lane (id or existing name). | |
link | ||
name | ||
project | Configured project (world) name. Omit to use the default project; see list_projects. | |
show_on_calendar | ||
start | Date in the timeline's calendar, as people write it: '1492', 'Mirtul 1492', '3 March 1204', '1204-03-03'. Parsed by LegendKeeper with the document's calendar. | |
start_minutes |
delete_timeline_event
Delete an event from a timeline.
| Parameter | Type | Description |
|---|---|---|
event_id * | string | |
resource * | string | Resource id, or its exact name/alias (case-insensitive). |
confirm | boolean | Must be true. |
document | Document id or name within the resource. Omit to pick the resource's main document. | |
project | Configured project (world) name. Omit to use the default project; see list_projects. |
create_timeline_lane
Add a lane (row) to a timeline, placed after the existing lanes.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
resource * | string | Resource id, or its exact name/alias (case-insensitive). |
color | Color for every event in the lane. | |
document | Document id or name within the resource. Omit to pick the resource's main document. | |
project | Configured project (world) name. Omit to use the default project; see list_projects. | |
size | string |
upload_image
Upload an image to the world's asset library and return its asset id and URL. Use the URL in a page image (), a resource banner (update_resource banner_url) or as a map image (create_document / update_document map_image_asset_id).
| Parameter | Type | Description |
|---|---|---|
source * | string | Local file path (as seen by this server) or an http(s) URL of a JPEG/PNG/GIF/WebP. |
description | ||
folder_id | Asset folder id (see list_assets). | |
name | Asset name (default: file name). | |
project | Configured project (world) name. Omit to use the default project; see list_projects. |
api_request
Call any LegendKeeper REST v3 endpoint of this project directly (advanced: boards, calendars, block-level edits, properties, invites, restores…). Returns the raw JSON response. Writes are disabled in read-only mode.
| Parameter | Type | Description |
|---|---|---|
method * | string | |
path * | string | Path relative to the project, e.g. '/resources/<id>/docs/<docId>/blocks', '/calendars', '/resources/<id>/properties'. See https://www.legendkeeper.com/developers/api/. |
body | JSON request body. | |
confirm | boolean | Required (true) for DELETE. |
if_match | Document/calendar version for optimistic locking. | |
project | Configured project (world) name. Omit to use the default project; see list_projects. | |
query | Query-string parameters. |