LegendKeeper

v0.1.2
io.github.chase-roohms/legendkeeper-mcp Checked 2 days ago Published 1 month ago

Read 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.

ParameterTypeDescription
depthintegerHow many levels to expand.
parentResource id or name to list below. Omit for the top of the world.
projectConfigured project (world) name. Omit to use the default project; see list_projects.
refreshbooleanBypass the 60-second resource cache.
show_document_typesbooleanShow document types for resources that are not a single page.

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.

ParameterTypeDescription
resource *stringResource id, or its exact name/alias (case-insensitive).
projectConfigured 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.

ParameterTypeDescription
projectConfigured 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.

ParameterTypeDescription
projectConfigured 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.

ParameterTypeDescription
projectConfigured 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).

ParameterTypeDescription
projectConfigured 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.

ParameterTypeDescription
folder_idAsset folder id; omit for the library root.
limitinteger
projectConfigured 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.

ParameterTypeDescription
resource *stringResource id, or its exact name/alias (case-insensitive).
documentDocument id or name within the resource. Omit to pick the resource's main document.
formatstringmarkdown (default, editable), text (plain text) or json (raw API data).
opaque_blocksstringHow page blocks Markdown cannot express are shown: 'keep' = readable summary between lk:keep markers (preserved on write), 'json' = editable ```lk-block JSON fences.
projectConfigured 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.

ParameterTypeDescription
markdown *stringPage content in LegendKeeper Markdown (see legendkeeper://guides/markdown).
mode *stringappend/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 *stringResource id, or its exact name/alias (case-insensitive).
documentDocument id or name within the resource. Omit to pick the resource's main document.
expected_versionThe 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'.
projectConfigured project (world) name. Omit to use the default project; see list_projects.
sectionHeading 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.

ParameterTypeDescription
name *string
resource *stringResource id, or its exact name/alias (case-insensitive).
type *stringpage (wiki text), map, time (timeline) or board (whiteboard).
calendar_idFor timelines: calendar id from list_calendars (e.g. 'gregorian').
is_hiddenbooleanHide the document from non-admins.
map_image_asset_idFor maps: id of an uploaded image asset to use as the map.
projectConfigured 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.

ParameterTypeDescription
document *stringDocument id or name.
resource *stringResource id, or its exact name/alias (case-insensitive).
calendar_idTimeline calendar id.
is_full_width
is_hidden
map_image_asset_idImage asset id to set as the map image.
name
projectConfigured 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).

ParameterTypeDescription
document *stringDocument id or name.
resource *stringResource id, or its exact name/alias (case-insensitive).
confirmbooleanMust be true. Ask the user before deleting.
projectConfigured 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.

ParameterTypeDescription
name *string
afterSibling (id or name) to place this one after.
aliases
calendar_idCalendar for a `time` document.
contentMarkdown for the new page. [[Name]] links become mentions.
document_nameFirst document's name.
document_typeType of the first document when there is no `content` (default: blank).
icon_color
icon_glyphFont Awesome icon name, e.g. 'dragon'.
icon_shape
is_hiddenCreate hidden (ADMIN keys only).
parentParent resource id or name. Omit (or 'root') for the top level.
projectConfigured 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`.

ParameterTypeDescription
resources *array1-100 resources, created in order.
projectConfigured 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.

ParameterTypeDescription
resource *stringResource id, or its exact name/alias (case-insensitive).
add_aliases
add_tagsTags to add (kept if already present).
aliasesReplace all aliases.
banner_enabled
banner_urlBanner image URL (must be an uploaded asset URL, see upload_image).
banner_y_positionBanner focus, 0-100.
icon_color
icon_glyphFont Awesome icon name.
icon_shape
is_hiddenHide/show (ADMIN keys only).
is_locked
name
projectConfigured project (world) name. Omit to use the default project; see list_projects.
remove_tagsTags to remove.
tagsReplace all tags with this list.

move_resource

Move a resource (and its children) to another parent and/or position among its siblings.

ParameterTypeDescription
resource *stringResource id, or its exact name/alias (case-insensitive).
afterPlace after this sibling (id or name).
beforePlace before this sibling (id or name).
new_parentNew parent id or name, or 'root' for the top level. Omit to keep the parent.
projectConfigured 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.

ParameterTypeDescription
resource *stringResource id, or its exact name/alias (case-insensitive).
cascadebooleanAlso delete all child resources.
confirmbooleanMust be true. Ask the user before deleting.
projectConfigured 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).

ParameterTypeDescription
resource_id *stringId of the deleted resource.
projectConfigured 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).

ParameterTypeDescription
template *stringTemplate id or name (see list_templates).
include_childrenbooleanAlso copy the template's child resources.
nameName of the new resource (default: template name).
parentParent id or name; omit for top level.
projectConfigured 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.

ParameterTypeDescription
facts *objectFact 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 *stringResource id, or its exact name/alias (case-insensitive).
documentDocument id or name within the resource. Omit to pick the resource's main document.
projectConfigured project (world) name. Omit to use the default project; see list_projects.
targetstringinfobox: the box at the top of the page (created if missing). sidebar: properties.
titleTitle 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.

ParameterTypeDescription
name *string
resource *stringResource id, or its exact name/alias (case-insensitive).
colorRegion fill/border or path line color.
documentDocument id or name within the resource. Omit to pick the resource's main document.
extraAny other createFeature fields (labelSize, fillOpacity, strokeWidth, textColor…).
folderId of a folder feature to nest this feature in.
icon_colorPin shape color (only with a shape).
icon_glyphPin icon: a Font Awesome name, e.g. 'castle'.
icon_shapeShape behind a pin's glyph; default 'none' (bare glyph).
is_hidden
linkResource id/name (or lk:// URI) the feature opens when clicked.
pixel_coordinatesbooleanTreat position/points as image pixels [x, y] from the top-left corner.
pointsVertices of a region (polygon) or a path (polyline).
positionPin/label position.
projectConfigured project (world) name. Omit to use the default project; see list_projects.
typestringFeature type.

update_map_feature

Change a map feature: rename, move, reshape, relink, restyle or hide it.

ParameterTypeDescription
feature_id *string
resource *stringResource id, or its exact name/alias (case-insensitive).
color
documentDocument id or name within the resource. Omit to pick the resource's main document.
extraOther updateFeature fields.
icon_color
icon_glyph
icon_shape
is_hidden
linkResource id/name or lk:// URI.
name
pixel_coordinatesboolean
points
position
projectConfigured 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.

ParameterTypeDescription
feature_id *string
resource *stringResource id, or its exact name/alias (case-insensitive).
confirmbooleanMust be true.
documentDocument id or name within the resource. Omit to pick the resource's main document.
projectConfigured 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.

ParameterTypeDescription
name *stringShort event name (events have no description).
resource *stringResource id, or its exact name/alias (case-insensitive).
color
documentDocument id or name within the resource. Omit to pick the resource's main document.
endDate 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
laneLane id or name; a new lane is created if the name does not exist.
linkResource id/name (or lk:// URI) with the full story.
projectConfigured project (world) name. Omit to use the default project; see list_projects.
show_on_calendar
startDate 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_minutesExact start in calendar minutes (alternative to `start`).
typestring'event' or a 'note' annotation.

update_timeline_event

Change a timeline event's name, dates, lane, link or style.

ParameterTypeDescription
event_id *string
resource *stringResource id, or its exact name/alias (case-insensitive).
color
documentDocument id or name within the resource. Omit to pick the resource's main document.
endDate 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
laneMove to this lane (id or existing name).
link
name
projectConfigured project (world) name. Omit to use the default project; see list_projects.
show_on_calendar
startDate 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.

ParameterTypeDescription
event_id *string
resource *stringResource id, or its exact name/alias (case-insensitive).
confirmbooleanMust be true.
documentDocument id or name within the resource. Omit to pick the resource's main document.
projectConfigured 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.

ParameterTypeDescription
name *string
resource *stringResource id, or its exact name/alias (case-insensitive).
colorColor for every event in the lane.
documentDocument id or name within the resource. Omit to pick the resource's main document.
projectConfigured project (world) name. Omit to use the default project; see list_projects.
sizestring

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 (![alt](url)), a resource banner (update_resource banner_url) or as a map image (create_document / update_document map_image_asset_id).

ParameterTypeDescription
source *stringLocal file path (as seen by this server) or an http(s) URL of a JPEG/PNG/GIF/WebP.
description
folder_idAsset folder id (see list_assets).
nameAsset name (default: file name).
projectConfigured 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.

ParameterTypeDescription
method *string
path *stringPath relative to the project, e.g. '/resources/<id>/docs/<docId>/blocks', '/calendars', '/resources/<id>/properties'. See https://www.legendkeeper.com/developers/api/.
bodyJSON request body.
confirmbooleanRequired (true) for DELETE.
if_matchDocument/calendar version for optimistic locking.
projectConfigured project (world) name. Omit to use the default project; see list_projects.
queryQuery-string parameters.