foundryvtt-mcp
v3.1.0Model Context Protocol server for FoundryVTT integration
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
roll_dice
Roll dice and return the total with a per-term breakdown. Dice terms and whole numbers joined by + or -, with whitespace allowed anywhere ("1d20+5", "1d20 + 5", "1d20+5+3", "2d6 + 1d4", "3d6"; a count-less "d20" means one die), always work and every term counts towards the total - that is the portable grammar, safe on either transport. Multiplication and Foundry modifier syntax such as "4d6kh3" or "1d20r1" are rejected on both transports, with an error naming the offending character and its position, never dropped from the total in silence. Parentheses are the one difference: with FOUNDRY_API_…
| Parameter | Type | Description |
|---|---|---|
formula * | string | Dice formula (e.g., "1d20+5", "3d6") |
reason | string | Optional reason for the roll |
search_actors
Search actors (player characters, NPCs) by name, optionally filtered by type. Returns a summary line per match: name, type, and the level and current/max hit points when the actor stores them at details.level and attributes.hp. Use when: checking whether an actor exists, or getting a quick roster. Do not use when: you already have the actorId and want more of that actor's values - use get_actor_details; or you need the actorId itself, which this tool does not print - read the foundry://actors resource, whose JSON lists up to the first 100 actors with their _id (not exhaustive in larger worlds)…
| Parameter | Type | Description |
|---|---|---|
cursor | string | Opaque pagination cursor from a previous response to fetch the next page |
limit | number | Maximum number of results to return |
query | string | Search query for actor names |
type | string | Actor type filter (character, npc, etc.) |
get_actor_details
Get details for one actor by id: type, and the level, current/max hit points, armour class and ability values the actor stores at details.level, attributes.hp, attributes.ac and abilities (a game system that stores them elsewhere shows fewer fields; get_actor_stats returns all of its data); no biography or description text is returned (the description line always reads "No description available."). Use when: you have an actorId and need its current values - notably as the read-before-write step for update_actor_attributes. For one token on a map, give sceneId + tokenId instead of actorId: an u…
| Parameter | Type | Description |
|---|---|---|
actorId | string | The ID of the actor to retrieve (omit when giving sceneId + tokenId) |
sceneId | string | Scene id of the token, required together with tokenId |
tokenId | string | Token id: reads that token's own actor (base actor and the token's changes merged, for an unlinked token) instead of actorId |
get_actor_inventory
List an actor's owned items (equipment, features, abilities…) with full system data per item, unlike get_actor_details which only reports the actor's own top-level stats. Use when: checking what a character or NPC carries or knows before an action or a trade. For one token on a map, give sceneId + tokenId instead of actorId: an unlinked token lists its own items (those it inherits from its base actor and its own, without the ones removed from it), a linked token its world actor's. Do not use when: you only need the actor's own values - use get_actor_details.
| Parameter | Type | Description |
|---|---|---|
actorId | string | The ID of the actor whose inventory to list (omit when giving sceneId + tokenId) |
sceneId | string | Scene id of the token, required together with tokenId |
tokenId | string | Token id: lists the items of that token's own actor (base actor and the token's changes merged, for an unlinked token) instead of actorId |
update_actor_attributes
Update fields on an actor's system data. Patch keys are dot-paths into actor.system (e.g. "attributes.health.value", "resources.primary.value", "details.notes") and values are absolute target values, never relative deltas. If the actor stores a value at one of these paths, it is range-checked: attributes.hp.value against max + temp, spells.<key>.value against the max of that entry, and attributes.exhaustion against 0-10 (0-6 when the data of the actor marks older rules). Returns the post-update value for every patched path. Use when: applying damage or healing, spending a resource, or adjustin…
| Parameter | Type | Description |
|---|---|---|
patch * | object | Map of dot-path → value, where each dot-path addresses a field under actor.system (e.g. {"attributes.health.value": 30, "resources.primary.value": 2}). Values must be number, string, or boolean. |
actorId | string | The ID of the actor to update (omit when giving sceneId + tokenId) |
sceneId | string | Scene id of the token to update, required together with tokenId |
tokenId | string | Token id: updates that token's own actor (its delta, for an unlinked token) instead of actorId |
create_world_actor
Create a new top-level Actor document (a permanent NPC or character sheet in the sidebar), optionally seeded with system data and filed under a folder. Use when: a new NPC or creature needs to exist as a persistent document, not just described in text. Do not use when: a quick throwaway description is enough - use generate_npc; or when adding an item to an actor that already exists - use create_actor_item. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permis…
| Parameter | Type | Description |
|---|---|---|
name * | string | Actor display name |
type * | string | Game-system actor type (e.g. "character", "npc") |
flags | object | Optional module flags for actor.flags, keyed by module id, e.g. {"my-module": {"key": "value"}} for data a module reads from the new actor |
folder | string | Optional Folder document id to file the actor under |
system | object | Optional system-specific data merged into actor.system |
create_full_actor
Create a new top-level Actor document AND seed it with starting items (gear, weapons, features, …) in one call, instead of create_world_actor followed by one create_actor_item per item. Pairs with get_document_schema: call that once per Actor/Item type to learn the real field names for `system`, then build the whole character here in a single call. The actor is always created first - a failure there aborts the whole call. Item creation is best-effort per item, not atomic: a bad item (e.g. a typo'd type) is reported in the response's item-failures list rather than losing the actor or the item…
| Parameter | Type | Description |
|---|---|---|
name * | string | Actor display name |
type * | string | Game-system actor type (e.g. "character", "npc") |
folder | string | Optional Folder document id to file the actor under |
items | array | Optional starting items (weapons, gear, features, …) to create on the actor immediately after it exists |
system | object | Optional system-specific data merged into actor.system - use get_document_schema("Actor", type) to learn the real field names first |
delete_world_actor
Permanently delete a top-level Actor document. Use when: the user explicitly asks to remove an NPC or character sheet, and has given you the actorId. Do not use when: only removing a token placed on a scene - use delete_token; the actor document is untouched by that. DESTRUCTIVE and not undoable from this server: confirm the exact target with the user before calling. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
actorId * | string | The ID of the actor to delete |
search_items
Search item documents in the world by name, optionally filtered by type. Returns name, type and rarity per match (rarity shows "Common" when the system records none); price is not available and always prints "Unknown price", and the rarity filter is ignored unless the REST API module is configured (FOUNDRY_API_KEY). Item ids are not printed - read the foundry://items resource, whose JSON lists up to the first 100 items with their _id (not exhaustive in larger worlds). Use when: checking whether an item exists in the world. Do not use when: searching compendium packs (use search_compendium) or…
| Parameter | Type | Description |
|---|---|---|
cursor | string | Opaque pagination cursor from a previous response to fetch the next page |
limit | number | Maximum number of results to return |
query | string | Search query for item names |
rarity | string | Item rarity filter (common, uncommon, rare, etc.). Applied only in REST API mode (FOUNDRY_API_KEY); ignored on the default Socket.IO path. |
type | string | Item type filter (weapon, armor, consumable, etc.) |
search_compendium
Search FoundryVTT compendium packs by name and metadata; searches all enabled packs unless compendiumId scopes it to one pack. Use when: looking up creatures, items or rules that are not yet present in the world. Do not use when: the document already exists in the world - use search_items or search_world. Requires the REST API module (FOUNDRY_API_KEY); without it the search returns no results instead of failing.
| Parameter | Type | Description |
|---|---|---|
query * | string | Search query for compendium entry names |
cursor | string | Opaque pagination cursor from a prior result's "Next page" cursor; omit for the first page |
filters | object | Optional metadata filters to narrow the search |
limit | number | Maximum number of results per page |
create_actor_item
Create an item on an actor from an inline item document (type, name, system) or by referencing a compendium pack entry (compendium sources require the companion Foundry module). Use when: adding a new weapon, feature, or piece of equipment to a known actorId. For one token on a map, give sceneId + tokenId (an actorId given as well must be the actor of the token): an unlinked token gets the item on that token only, a linked token on its world actor. Do not use when: editing an item the actor already owns - use update_actor_item. Replacing an item is not atomic: create the replacement first and…
| Parameter | Type | Description |
|---|---|---|
source * | object | Item source. Either { type: "inline", item: { type, name, system } } or { type: "compendium", compendiumId, itemId } (requires companion module). |
actorId | string | The ID of the actor to add the item to (omit when giving sceneId + tokenId) |
sceneId | string | Scene id of the token, required together with tokenId |
tokenId | string | Token id: adds the item to that token's own actor instead of actorId (only that token, for an unlinked token) |
update_actor_item
Apply a JSON merge patch to an item's system data on an actor: nested paths such as activities.{id}.consumption.targets are supported, values are absolute (arrays replace, null deletes). Use when: changing fields on an item the actor already owns, given actorId + itemId. For one token on a map, give sceneId + tokenId: on an unlinked token only that token changes, even for an item it inherits from its base actor. Do not use when: adding a new item (create_actor_item) or removing one (delete_actor_item). Canonical target: D&D 5e v4+ activity schema. WRITE: mutates the live world. Requires FOUNDR…
| Parameter | Type | Description |
|---|---|---|
itemId * | string | The ID of the item to update |
patch * | object | JSON merge patch applied to item.system; nested paths supported (e.g. activities.{id}.consumption.targets) |
actorId | string | The ID of the actor that owns the item (omit when giving sceneId + tokenId) |
sceneId | string | Scene id of the token, required together with tokenId |
tokenId | string | Token id: changes the item on that token's own actor instead of actorId (only that token, for an unlinked token) |
delete_actor_item
Permanently remove an item owned by an actor. Use when: the user explicitly asks to delete or discard a specific owned item, and you have its itemId from the user or from get_actor_inventory (which lists the ids of the items an actor owns) - never guess one. For one token on a map, give sceneId + tokenId: an unlinked token loses the item on that token only, even one it inherits from its base actor. Do not use when: only the item's data needs to change - use update_actor_item. In a replacement or migration flow, run create_actor_item first and this second: the two calls are not atomic, and fail…
| Parameter | Type | Description |
|---|---|---|
itemId * | string | The ID of the item to delete |
actorId | string | The ID of the actor that owns the item (omit when giving sceneId + tokenId) |
sceneId | string | Scene id of the token, required together with tokenId |
tokenId | string | Token id: deletes the item from that token's own actor instead of actorId (only that token, for an unlinked token) |
get_scene_info
Get details of the active scene, or of a specific scene by id: name, scene id, active/navigation flags, pixel dimensions, padding, grid (type, size in pixels, distance, units), and lighting (global light, darkness); no description text is returned unless a module has set a description flag on the scene (the description line otherwise reads 'No description available.'). Use when: you need the sceneId, grid size, or the scene's pixel extents. Do not use when: looking a scene up by name (use search_world), or you need token/tile coordinates - this tool returns neither; use list_tiles or the found…
| Parameter | Type | Description |
|---|---|---|
sceneId | string | Optional scene ID. If not provided, returns current scene |
create_scene
Create a new Scene document from a background image already present under FoundryVTT's Data directory (see list_scene_assets to browse available map art). Width/height default to the image's real pixel dimensions read from disk (requires FOUNDRY_DATA_PATH) — the single biggest source of a misaligned grid when set by hand; pass width/height explicitly to override. Use when: a new location needs a scene before the party arrives there, or a fresh battlemap needs to exist as a document. Do not use when: the scene already exists - use switch_scene to activate it, or set_scene_lighting to change i…
| Parameter | Type | Description |
|---|---|---|
backgroundSrc * | string | Data-relative path to the background image (e.g. "assets/maps/v1/x.jpg"), as returned by list_scene_assets |
name * | string | Scene display name |
activate | boolean | Optional; true to immediately activate the new scene for all players |
backgroundColor | string | Hex color shown outside the background image (default "#999999") |
gridDistance | number | Real-world distance one grid cell represents (default 1) |
gridSize | number | Grid cell size in pixels (default 100) |
gridType | number | Foundry grid type constant (default 1 = square) |
gridUnits | string | Unit label for gridDistance (e.g. "ft", "m") (default "ft") |
height | number | Optional explicit pixel height; defaults to the image's real height |
padding | number | Fractional canvas padding around the background image (default 0.25) |
width | number | Optional explicit pixel width; defaults to the image's real width |
switch_scene
Activate a scene, switching every connected player's canvas to it. FoundryVTT enforces a single active scene server-side, so activating one automatically deactivates whichever scene was active before - no separate deactivation call is needed. Use when: the party moves to a new map (new area, travel, a battle starting on a prepared map). Do not use when: you only need to read scene info - use get_scene_info. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permi…
| Parameter | Type | Description |
|---|---|---|
sceneId * | string | The ID of the scene to activate |
delete_scene
Permanently delete a Scene document. Use when: the user explicitly asks to remove a map that is no longer needed. Do not use when: you only want to stop showing it to players - use switch_scene to activate a different one instead; deleting the active scene leaves no scene active. DESTRUCTIVE and not undoable from this server: confirm the exact target with the user before calling. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
sceneId * | string | The ID of the scene to delete |
set_scene_lighting
Set a scene's ambient darkness level (0-1) and/or global illumination (globalLight, globalLightThreshold). Written to the Scene document's environment fields (environment.darknessLevel, environment.globalLight) - no canvas access required. Use when: transitioning to night, dimming a room, or lighting a torch-lit area. Do not use when: you only need to read current lighting - use get_scene_info. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the…
| Parameter | Type | Description |
|---|---|---|
sceneId * | string | The ID of the scene to update |
darkness | number | Ambient darkness level, 0 (fully lit) to 1 (pitch black) |
globalLight | boolean | Whether the whole scene is globally illuminated |
globalLightThreshold | number | Darkness level above which global light is suppressed |
reset_fog
Reset fog of war exploration progress for a scene, defaulting to the active scene when sceneId is omitted. DESTRUCTIVE and not undoable from this server: confirm the exact target with the user before calling. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
sceneId | string | Optional Scene ID; defaults to the active scene |
set_scene_weather
Set or clear weather effects on a scene (e.g. "rain", "snow", "leaves", "rainStorm", "fog", or empty string "" to clear). Default values come from Foundry core; additional effects may be available if weather modules are installed. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
weather * | string | Weather effect key (e.g. "rain", "snow", "leaves", "rainStorm", "fog"), or "" to clear |
sceneId | string | Optional Scene ID; defaults to the active scene |
list_walls
List the Walls on a scene (id, endpoints, and the move/sight/door/ds fields), defaulting to the active scene when sceneId is omitted. Read from cached worldData - no canvas access needed. Use when: finding a wallId for delete_wall/set_door_state, or checking a scene's current wall layout before adding more. Do not use when: you need tile or token positions instead - this only lists Wall documents.
| Parameter | Type | Description |
|---|---|---|
sceneId | string | Optional Scene ID; defaults to the active scene |
create_wall
Create a new Wall segment on a scene - the structural building block for rooms, corridors, and doors. Unlike create_tile (which centres in a cell), a wall connects two grid *vertices* (intersections): fromCol/fromRow -> toCol/toRow, e.g. fromCol:3,fromRow:5 -> toCol:4,toRow:5 is the one-cell-long top edge of cell (3,5); a longer run spans multiple cells in one call. Alternatively pass explicit pixel x1/y1/x2/y2. type selects one of FoundryVTT's own named wall presets (the ones its wall-tool palette offers): "wall" (default, solid - blocks movement and sight), "door" (openable via set_door_stat…
| Parameter | Type | Description |
|---|---|---|
sceneId * | string | The ID of the scene to place the wall on |
fromCol | number | Start grid vertex column. Alternative to x1/y1. |
fromRow | number | Start grid vertex row. Alternative to x1/y1. |
toCol | number | End grid vertex column. Alternative to x2/y2. |
toRow | number | End grid vertex row. Alternative to x2/y2. |
type | string | Wall nature (default "wall"): wall = solid; door = openable, starts closed; secretDoor = hidden until discovered, starts closed; terrain = blocks movement, sight blocks only on the second crossing; in… |
x1 | number | Start pixel x coordinate. Alternative to fromCol/fromRow. |
x2 | number | End pixel x coordinate. Alternative to toCol/toRow. |
y1 | number | Start pixel y coordinate. Alternative to fromCol/fromRow. |
y2 | number | End pixel y coordinate. Alternative to toCol/toRow. |
delete_wall
Remove a Wall from a scene. Use when: undoing a placement mistake, or opening up a room by removing a wall segment entirely (as opposed to opening a door - use set_door_state to keep the wall and just toggle it). Do not use when: you want to remove a tile or token instead - this only affects Wall documents. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
sceneId * | string | The ID of the scene the wall is on |
wallId * | string | The ID of the wall to remove |
set_door_state
Open, close, or lock a door (a Wall document with door !== 0). Use when: a party opens or shuts a door, or a door should be locked/unlocked. Do not use when: you don't have the wallId - use list_walls, or ask the user, or read the foundry://scenes resource. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
state * | number | 0 = closed, 1 = open, 2 = locked |
wallId * | string | The ID of the door (Wall document) to change |
sceneId | string | Optional Scene ID to scope the wall lookup |
list_scene_assets
List image assets (map backgrounds, prop/token art) under a folder of the FoundryVTT Data directory, with real pixel dimensions and any `[Tag, Tag]`-bracketed keyword tags parsed out of the filename (the naming convention several battlemap packs use). Requires FOUNDRY_DATA_PATH — this server must run on the same host as FoundryVTT. Use when: choosing a background for create_scene, or browsing available decoration art for create_tile before placing anything. Do not use when: FOUNDRY_DATA_PATH is not set - this always returns empty in that case.
| Parameter | Type | Description |
|---|---|---|
kind | string | Asset category to scan for: "image" (default) or "audio" |
limit | number | Maximum results to return (default 200) |
query | string | Optional case-insensitive substring filter on filename or parsed tags |
subdir | string | Data-relative folder to scan (default "assets") |
list_tiles
List the Tiles placed on a scene (id, image src, position, size, rotation, hidden), defaulting to the active scene when sceneId is omitted. Read from cached worldData - no capture_scene screenshot needed to see current decoration state. Use when: checking what is already placed before adding more, or getting a tileId for delete_tile. Do not use when: you need token positions instead of tile positions - tiles and tokens are separate document types; this only lists tiles.
| Parameter | Type | Description |
|---|---|---|
sceneId | string | Optional Scene ID; defaults to the active scene |
find_open_cells
Scan a scene's grid for cells with no wall crossing them and no existing tile/token already centred there - a placement candidate list for create_tile/spawn_token that needs no screenshot to compute. Restricted to the background image's own extent; the scene's padding margin is never returned as floor. Use when: deciding where to place a new tile or token without visual inspection. Do not use when: you already have a specific target position in mind - this is for open-ended 'somewhere sensible' placement, not for verifying one exact spot.
| Parameter | Type | Description |
|---|---|---|
sceneId * | string | The ID of the scene to scan |
limit | number | Maximum open cells to return (default 50) |
create_tile
Place a decorative Tile on a scene from an image already present under FoundryVTT's Data directory (see list_scene_assets). Width/height default to the image's real pixel dimensions when not given. Position is either explicit pixel x/y (top-left corner) or a gridCol/gridRow cell (the tile is centred in that cell - see find_open_cells for candidates). By default refuses to place a tile whose bounding box crosses a scene wall; pass allowWallOverlap: true to place anyway (e.g. a wall-mounted prop). Use when: decorating a scene with scenery (crates, dumpsters, vehicles, graffiti) that is not a cre…
| Parameter | Type | Description |
|---|---|---|
sceneId * | string | The ID of the scene to place the tile on |
src * | string | Data-relative path to the tile image, as returned by list_scene_assets |
allowWallOverlap | boolean | Optional; true to allow placement even if the bounding box crosses a wall (default false - refuses) |
elevation | number | Optional elevation (default 0) |
gridCol | number | Grid column to centre the tile in. Alternative to x/y. |
gridRow | number | Grid row to centre the tile in. Alternative to x/y. |
height | number | Optional explicit pixel height; defaults to the image's real height |
hidden | boolean | Optional; true to place the tile hidden from players |
rotation | number | Optional rotation in degrees (default 0) |
width | number | Optional explicit pixel width; defaults to the image's real width |
x | number | Target top-left x pixel coordinate. Alternative to gridCol/gridRow. |
y | number | Target top-left y pixel coordinate. Alternative to gridCol/gridRow. |
delete_tile
Remove a Tile from a scene. Use when: undoing a placement mistake, or clearing decoration that no longer fits the scene. Do not use when: you want to remove a token or actor instead - this only affects Tile documents; use delete_token or delete_world_actor. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
sceneId * | string | The ID of the scene the tile is on |
tileId * | string | The ID of the tile to remove |
get_combat_state
Get the active combat encounter: initiative order with each combatant's name and initiative, its hit points and armour class when its actor stores them at attributes.hp and attributes.ac, plus the current round and which combatant is up. Use when: reporting whose turn it is, or checking whether a combat is already running before start_combat. Do not use when: you need a combatantId for set_initiative - this prints names and ordinals, not ids; read the foundry://combat resource, whose JSON includes each combatant's _id and lists combatants in this same initiative order, so the Nth entry printed…
list_lights
List the AmbientLight sources placed on a scene (id, position, dim/bright radius, color, rotation, animation, hidden), defaulting to the active scene when sceneId is omitted. Read from cached worldData - no canvas access needed. Use when: inspecting scene lighting or finding a lightId for update_light/delete_light.
| Parameter | Type | Description |
|---|---|---|
sceneId | string | Optional Scene ID; defaults to the active scene |
list_sounds
List the AmbientSound sources placed on a scene (id, position, radius, audio path, volume, repeat, hidden), defaulting to the active scene when sceneId is omitted. Read from cached worldData - no canvas access needed. Use when: inspecting ambient audio or finding a soundId for delete_sound.
| Parameter | Type | Description |
|---|---|---|
sceneId | string | Optional Scene ID; defaults to the active scene |
list_notes
List the Map Notes (journal pins) placed on a scene (id, position, label text, linked journal entry and page, global visibility), defaulting to the active scene when sceneId is omitted. Read from cached worldData - no canvas access needed. Use when: finding pins on the map or getting a noteId for delete_note.
| Parameter | Type | Description |
|---|---|---|
sceneId | string | Optional Scene ID; defaults to the active scene |
list_drawings
List the Drawings placed on a scene (id, shape type, position, dimensions/radius, text label, colors, hidden, locked), defaulting to the active scene when sceneId is omitted. Read from cached worldData - no canvas access needed. Use when: inspecting canvas shapes or finding a drawingId for delete_drawing.
| Parameter | Type | Description |
|---|---|---|
sceneId | string | Optional Scene ID; defaults to the active scene |
list_templates
List the Measured Templates (area-of-effect shapes) placed on a scene (id, template type, position, distance, direction, angle, width, colors, hidden), defaulting to the active scene when sceneId is omitted. Read from cached worldData - no canvas access needed. Use when: inspecting active areas of effect or finding a templateId for delete_template.
| Parameter | Type | Description |
|---|---|---|
sceneId | string | Optional Scene ID; defaults to the active scene |
create_light
Create a new AmbientLight source on a scene at either pixel x/y or a gridCol/gridRow cell (the light is centered in that cell). Supports dim/bright radii, color hex tint (#rrggbb), angle, rotation, and animation presets (e.g. torch, pulse, chroma). WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
angle | number | Light emission angle in degrees (default 360) |
animationIntensity | number | Animation intensity 1-10 (default 5) |
animationSpeed | number | Animation speed 0-10 (default 5) |
animationType | string | Optional animation type (e.g. "torch", "pulse", "chroma", "wave") |
bright | number | Bright light radius in grid units (default 0) |
color | string | Light color as a 6-digit hex string (e.g. "#ff8800") |
dim | number | Dim light radius in grid units (default 0) |
gridCol | number | Grid column (centers in cell) |
gridRow | number | Grid row (centers in cell) |
hidden | boolean | Whether the light source is hidden (default false) |
rotation | number | Light rotation in degrees (default 0) |
sceneId | string | Optional Scene ID; defaults to the active scene |
vision | boolean | Whether this light provides vision to tokens (default false) |
walls | boolean | Whether light is constrained by walls (default true) |
x | number | Pixel x coordinate (center) |
y | number | Pixel y coordinate (center) |
update_light
Update an existing AmbientLight source on a scene (radii, color, position, angle, animation, walls/vision/hidden). WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
lightId * | string | The ID of the ambient light to update |
angle | number | Light emission angle in degrees |
bright | number | Bright light radius in grid units |
color | string | Light color as a 6-digit hex string (e.g. "#ff8800") |
dim | number | Dim light radius in grid units |
hidden | boolean | Whether the light source is hidden |
rotation | number | Light rotation in degrees |
sceneId | string | Optional Scene ID; defaults to the active scene |
vision | boolean | Whether this light provides vision |
walls | boolean | Whether light is constrained by walls |
x | number | New pixel x coordinate |
y | number | New pixel y coordinate |
delete_light
Permanently remove an AmbientLight from a scene. DESTRUCTIVE and not undoable from this server: confirm the exact target with the user before calling. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
lightId * | string | The ID of the ambient light to delete |
sceneId | string | Optional Scene ID; defaults to the active scene |
create_sound
Create an AmbientSound source on a scene from an audio file path (browse available audio via list_scene_assets with kind="audio"). Placement is either pixel x/y or a gridCol/gridRow cell. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
path * | string | Audio file path (e.g. "assets/audio/rain.mp3") |
easing | boolean | Whether volume fades towards the boundary (default true) |
gridCol | number | Grid column (centers in cell) |
gridRow | number | Grid row (centers in cell) |
hidden | boolean | Whether the sound is hidden/disabled (default false) |
radius | number | Audible radius in grid units (default 0) |
repeat | boolean | Whether the audio loops continuously (default false) |
sceneId | string | Optional Scene ID; defaults to the active scene |
volume | number | Playback volume 0.0 to 1.0 (default 0.5) |
walls | boolean | Whether sound is blocked by walls (default true) |
x | number | Pixel x coordinate (center) |
y | number | Pixel y coordinate (center) |
delete_sound
Permanently remove an AmbientSound from a scene. DESTRUCTIVE and not undoable from this server: confirm the exact target with the user before calling. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
soundId * | string | The ID of the ambient sound to delete |
sceneId | string | Optional Scene ID; defaults to the active scene |
create_note
Place a Map Note (journal pin) on a scene at pixel x/y or a gridCol/gridRow cell. Must link to an entryId (journal entry), provide text (standalone label), or both. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
entryId | string | Optional JournalEntry document ID to link to this pin |
fontSize | number | Label font size in pixels (8-128, default 32) |
global | boolean | Whether the note is visible regardless of fog/vision (default false) |
gridCol | number | Grid column (centers in cell) |
gridRow | number | Grid row (centers in cell) |
iconSize | number | Pin icon size in pixels (minimum 32, default 40) |
pageId | string | Optional JournalEntryPage ID within the linked entry |
sceneId | string | Optional Scene ID; defaults to the active scene |
text | string | Optional label text displayed below or on the pin |
textAnchor | number | Text anchor point: 0 (center), 1 (bottom/default), 2 (top), 3 (left), 4 (right) |
x | number | Pixel x coordinate (center) |
y | number | Pixel y coordinate (center) |
delete_note
Permanently remove a Map Note pin from a scene (does not delete the linked journal entry). DESTRUCTIVE and not undoable from this server: confirm the exact target with the user before calling. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
noteId * | string | The ID of the map note to delete |
sceneId | string | Optional Scene ID; defaults to the active scene |
create_drawing
Create a Drawing shape on a scene (rectangle "r", circle "c", ellipse "e", or polygon "p") with optional text, fill, and stroke styling. Position x, y is the top-left corner of the shape. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
x * | number | Pixel x coordinate (top-left) |
y * | number | Pixel y coordinate (top-left) |
fillAlpha | number | Fill opacity 0.0 to 1.0 (default 0.5) |
fillColor | string | Fill color as a 6-digit hex string (e.g. "#336699") |
fillType | number | Fill type: 0 (none), 1 (solid), 2 (pattern) |
fontSize | number | Font size in pixels (8-256, default 48) |
height | number | Height in pixels (required for "r" and "e") |
hidden | boolean | Whether the drawing is hidden from players (default false) |
locked | boolean | Whether the drawing is locked from interaction (default false) |
points | array | Array of coordinates [x1, y1, x2, y2, ...] with at least 3 points (required for "p") |
radius | number | Radius in pixels (required for "c") |
rotation | number | Rotation in degrees (default 0) |
sceneId | string | Optional Scene ID; defaults to the active scene |
shape | string | Shape type: "r" (rectangle, default), "c" (circle), "e" (ellipse), "p" (polygon) |
strokeColor | string | Stroke color as a 6-digit hex string (e.g. "#ffffff") |
strokeWidth | number | Stroke line width in pixels (default 8) |
text | string | Optional text label displayed inside the drawing |
width | number | Width in pixels (required for "r" and "e") |
delete_drawing
Permanently remove a Drawing from a scene. DESTRUCTIVE and not undoable from this server: confirm the exact target with the user before calling. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
drawingId * | string | The ID of the drawing to delete |
sceneId | string | Optional Scene ID; defaults to the active scene |
create_template
Place a Measured Template (area-of-effect shape: "circle", "cone", "rect", "ray") on a scene at pixel x/y or a gridCol/gridRow cell. Distance is specified in scene grid units (e.g. metres or feet). WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
distance * | number | Effect distance/radius in grid units (e.g. 6m or 30ft) |
angle | number | Cone spread angle in degrees (required for cone, e.g. 45 or 53.13) |
borderColor | string | Border color as a 6-digit hex string |
direction | number | Direction angle in degrees (0 = right, 90 = down; required for cone/ray/rect) |
fillColor | string | Fill color as a 6-digit hex string |
gridCol | number | Grid column (centers origin in cell) |
gridRow | number | Grid row (centers origin in cell) |
hidden | boolean | Whether the template is hidden from players (default false) |
sceneId | string | Optional Scene ID; defaults to the active scene |
t | string | Template type (default "circle") |
width | number | Ray line width in grid units (required for ray) |
x | number | Pixel x coordinate (origin point) |
y | number | Pixel y coordinate (origin point) |
delete_template
Permanently remove a Measured Template area-of-effect shape from a scene. DESTRUCTIVE and not undoable from this server: confirm the exact target with the user before calling. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
templateId * | string | The ID of the measured template to delete |
sceneId | string | Optional Scene ID; defaults to the active scene |
next_turn
Advance the active combat to the next turn, wrapping to the next round after the last combatant. When skipDefeated is true, defeated combatants are skipped. Use when: the current combatant has finished their turn. Do not use when: only reporting the turn order - use get_combat_state. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
skipDefeated | boolean | Skip combatants flagged as defeated when advancing. Defaults to the combat's skipDefeated setting, or false. |
end_combat
End the active combat encounter by deleting its Combat document, discarding the initiative order and round count. Use when: the fight is over and the user asks to end the encounter. DESTRUCTIVE and not undoable from this server: confirm the exact target with the user before calling. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
set_initiative
Set a combatant's initiative in the active combat (or in combatId when given), reordering the turn order. When that reorder moves the combatant who is currently acting to a different position, the encounter's turn index is rewritten to follow them - whoever was up stays up, and the result says so - rather than leaving the marker on whoever slid into the old slot. That follow-up applies only to the active combat: a combatId naming some other encounter still records the initiative, but its turn order is not readable here and is left alone. Use when: an initiative roll needs to be recorded or cor…
| Parameter | Type | Description |
|---|---|---|
combatantId * | string | The ID of the combatant whose initiative to set |
initiative * | number | The initiative value to assign |
combatId | string | Optional Combat document ID; defaults to the active combat |
start_combat
Start a new combat encounter, seeding combatants from tokens: pass explicit tokenIds, or omit them to seed every token on the scene. Defaults to the active scene when sceneId is omitted. The encounter begins at round 1, turn 0, as when the GM clicks Begin Combat in Foundry. With the companion module 0.7.0 or later, the combat is created in its browser session, so the game system prepares the combat and its combatants; without it, the combat is created over the socket, and when the game system defines combat types of its own, open browsers reject it until each user reloads FoundryVTT (F5); late…
| Parameter | Type | Description |
|---|---|---|
sceneId | string | Optional Scene document ID; defaults to the active scene. |
tokenIds | array | Optional list of Token document IDs to add as combatants. Defaults to all tokens on the scene. |
list_tokens
List the Tokens placed on a scene (id, display name, linked actorId, x/y pixel position, width/height in grid cells, elevation, rotation, hidden, disposition), defaulting to the active scene when sceneId is omitted. Read from cached worldData - no canvas access needed. Use when: you need to know what's on the map and where before moving, targeting, or applying an effect to a token, or to resolve a token's id from its name instead of asking the user. Do not use when: you need wall or tile layout instead - use list_walls/list_tiles.
| Parameter | Type | Description |
|---|---|---|
sceneId | string | Optional Scene ID; defaults to the active scene |
move_token
Move a token to new x/y pixel coordinates on its scene; the token is located across scenes by id, optionally scoped with sceneId. Coordinates are absolute pixels, not grid squares and not offsets. Use when: repositioning a token to a position the user has given you, or one computed from list_tokens (current positions) and get_scene_info (grid size). Do not use when: repositioning several tokens at once - use move_tokens; or the destination may be blocked by a wall/door - use move_token_pathfind, which routes around them instead of teleporting through. WRITE: mutates the live world. Requires FO…
| Parameter | Type | Description |
|---|---|---|
tokenId * | string | The ID of the token to move |
x * | number | Target x pixel coordinate on the scene |
y * | number | Target y pixel coordinate on the scene |
sceneId | string | Optional Scene ID to scope the token lookup |
apply_status_effect
Apply or remove a status condition (e.g. "prone", "stunned") on a token's actor. Set active=false to remove. Matches by status id, so re-applying or clearing-when-absent is a no-op. With the module bridge enabled, it first waits up to 10 s for the companion module if it is still connecting. With module 0.6.0 or later, the status goes through the game system's own status effects, so the system recognises the effect as its condition; effects carrying the status that were written earlier over the socket are reported when applying and removed with active=false. Some game systems ask for a value wh…
| Parameter | Type | Description |
|---|---|---|
statusId * | string | The status condition id (e.g. 'prone', 'stunned', 'blinded') |
tokenId * | string | The ID of the token whose actor to affect |
active | boolean | true to apply the effect (default), false to remove it |
createOptions | object | Optional creation options the game system reads when a status is created (at most 10 keys, 1 KiB of JSON; not the core's own options such as parent or keepId). Only with active=true, through the compa… |
sceneId | string | Optional Scene ID to scope the token lookup |
spawn_token
Place a new token for an existing actor onto a scene at given x/y pixel coordinates, defaulting to the active scene when sceneId is omitted. Base display fields (texture, size, vision) are seeded from the actor's prototypeToken. Use when: a creature, NPC, or reinforcement needs to appear on the map. Do not use when: repositioning a token that is already on the scene - use move_token. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
actorId * | string | The ID of the actor the new token represents |
x * | number | Target x pixel coordinate on the scene |
y * | number | Target y pixel coordinate on the scene |
hidden | boolean | Optional; true to place the token hidden from players |
name | string | Optional display name override; defaults to the actor's name |
sceneId | string | Optional Scene ID; defaults to the active scene |
delete_token
Remove a token from a scene without deleting the underlying actor. Use when: a creature is defeated and removed from the battle, or a token was placed by mistake. Do not use when: the actor document itself should be deleted - use delete_world_actor; this only removes the token's placement on the map. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
tokenId * | string | The ID of the token to remove |
sceneId | string | Optional Scene ID to scope the token lookup |
move_token_pathfind
Move a token to x/y coordinates, routing around impassable walls when the direct line is blocked (A* pathfinding over the scene's Wall geometry), and — unless openDoors is false — opening any closed doors the route needs to cross. Slower and more expensive than move_token (issues one document update per waypoint, with a short pause per door opened), and its wall detection covers ordinary geometric walls only, not anything canvas-only would also enforce (terrain height, drawing-based obstacles). Use when: a token should walk realistically around obstacles instead of teleporting through them…
| Parameter | Type | Description |
|---|---|---|
tokenId * | string | The ID of the token to move |
x * | number | Target x pixel coordinate on the scene |
y * | number | Target y pixel coordinate on the scene |
openDoors | boolean | Whether to open closed doors blocking the route (default true) |
sceneId | string | Optional Scene ID to scope the token lookup |
move_tokens
Move several tokens in a single call - direct by default (like move_token), or wall-aware pathfinding per move when pathfind=true (like move_token_pathfind). Best-effort: one bad move (unknown tokenId, no route found, a rejected write) is reported in a failure list rather than losing moves that already succeeded. Use when: repositioning a whole party or group of NPCs at once - e.g. moving everyone into a room, or resetting an encounter's starting positions - instead of one move_token/move_token_pathfind call per token. Do not use when: moving a single token - move_token/move_token_pathfind is…
| Parameter | Type | Description |
|---|---|---|
moves * | array | One or more token moves to perform in this call |
update_token_vision
Update an existing placed token's vision and/or light emission properties (sight range, angle, vision mode, light dim/bright radii, color tint, angle, animation). WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
tokenId * | string | The ID of the token to update |
lightAngle | number | Light emission angle in degrees (default 360) |
lightAnimationType | string | Light animation type (e.g. "torch", "pulse", "chroma") |
lightBright | number | Bright light emission radius in grid units |
lightColor | string | Light emission color as a 6-digit hex string (e.g. "#ff8800") |
lightDim | number | Dim light emission radius in grid units |
sceneId | string | Optional Scene ID to scope the token lookup |
sightAngle | number | Vision cone angle in degrees (default 360) |
sightEnabled | boolean | Whether vision is enabled for this token (automatically set true if sightRange > 0) |
sightRange | number | Token vision range in grid units |
visionMode | string | Vision mode id (e.g. "basic", "darkvision") |
get_chat_messages
Get the most recent chat messages from the game log. Use when: you need recent in-game context - what players said, or roll results that already happened.
| Parameter | Type | Description |
|---|---|---|
limit | number | Number of messages to retrieve (default 20) |
send_chat_message
Post a message to the FoundryVTT chat log, optionally under a custom speaker name, whispered to specific users, and/or styled as out-of-character, in-character, or an emote (default: a plain system-style message). Use when: narrating a scene, speaking as an NPC, or sending a player a private clue. Do not use when: you only need to read recent chat - use get_chat_messages. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
content * | string | Message body (HTML or plain text) |
speaker | string | Optional display name shown as the speaker (e.g. an NPC name) |
style | string | Message style. Omit for a plain message; 'ooc' out-of-character, 'ic' in-character, 'emote' an emote/action line. |
whisperTo | array | Optional list of User document ids to whisper the message to privately |
get_users
List the world's users with their roles and online status. Online status is live while the Socket.IO connection is up: FoundryVTT's userActivity broadcasts are applied to the cached presence list as users connect and disconnect. It stops tracking while that connection is down - get_health_status shows the snapshot as stale until the world is reloaded, on its own once the connection comes back, or with refresh_world_data. Use when: you need to know which user holds the GM role, or who is connected right now.
set_user_role
Change a user's permission role ("none", "player", "trusted", "assistant", "gamemaster"). Refuses self-demotion of the connected MCP user below assistant (3) to prevent accidental GM lockout. DESTRUCTIVE and not undoable from this server: confirm the exact target with the user before calling. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
role * | string | New role level for the user |
userId * | string | 16-char alphanumeric User document id |
search_journals
Search journal entries by name and page content. Use when: looking for notes, lore, or handouts by keyword. Do not use when: you already have the journalId - use get_journal.
| Parameter | Type | Description |
|---|---|---|
query * | string | Search query for journal names and content |
limit | number | Maximum number of results |
get_journal
Get one journal entry by id with the id and text of each page. By default page bodies are HTML-stripped and each is truncated to its first 500 characters, marked with a trailing "...", so long pages come back partial, and they come from the cached snapshot (flagged when it is stale). Pass raw: true to read the entry from the server instead, with the full, unmodified HTML and the version token of each page (version: <token>) - the expectedVersion update_journal_page requires to replace the content of that page. Use when: you have a journalId and need the text of its pages, or a pageId and the e…
| Parameter | Type | Description |
|---|---|---|
journalId * | string | The ID of the journal entry to retrieve |
raw | boolean | Read the entry from the server and return each page's full, unmodified HTML (text.content) and version token instead of the stripped 500-character preview. Use before rewriting a page so no markup or… |
create_journal_entry
Create a new journal entry with one or more text pages, optionally filed under a folder. Defaults to GM-only visibility - pass visibility to let players read it. Use when: recording session notes, lore, or a handout in the world. Returns the id and version token of each created page. Do not use when: adding text to an existing entry - this always creates a new one. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
name * | string | Title of the journal entry |
pages * | array | One or more pages to create on the entry |
folder | string | Optional Folder document id to file the entry under |
visibility | string | Who can see the entry. 'gm-only' (default) hides it from players; 'observer' lets every player read it; 'owner' lets every player read and edit it. |
update_journal_page
Edit one page of an existing journal entry. mode "replace" (default) sets a new name and/or replaces the whole page content; mode "append" adds HTML to the end of the page as currently stored on the server. Replacing content requires expectedVersion: read the page with get_journal raw: true, rewrite from that HTML, and pass the version printed for the page - the write is refused, with nothing written, if the page changed since. Every write saves the previous content to a local copy first, and returns the new version token so another edit can follow without re-reading. The response warns when t…
| Parameter | Type | Description |
|---|---|---|
journalId * | string | The ID of the journal entry that holds the page |
pageId * | string | The ID of the page to edit (shown by get_journal) |
content | string | Page body as HTML or plain text. In replace mode it replaces the entire page content; in append mode it is added at the end. |
expectedVersion | string | Version token of the page as last read (get_journal raw: true, or the version returned by the previous write). Required to replace content; optional in append mode. The write is refused if the page ha… |
mode | string | 'replace' (default) overwrites the page content with content (expectedVersion required) and/or renames it; 'append' adds content after the existing content as read from the server (name not allowed). |
name | string | New page title (replace mode only) |
add_journal_page
Add a new text page to an existing journal entry, placed after its last page as read from the server. Returns the new page id and version token. Use when: a journal needs another section (a new session, an NPC, a location). Do not use when: the entry does not exist yet - use create_journal_entry; changing an existing page - use update_journal_page. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
content * | string | Page body as HTML or plain text |
journalId * | string | The ID of the journal entry to add the page to |
name * | string | Page title |
update_journal_entry
Rename a journal entry, move it into another folder, or change who can see it. Only the fields supplied change. Use when: retitling notes, filing them under a folder, or revealing a handout to players. Do not use when: changing page text - use update_journal_page; granting a specific user access - use set_document_ownership. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
journalId * | string | The ID of the journal entry to update |
folder | string | Folder document id to move the entry into |
name | string | New title of the journal entry |
visibility | string | Who can see the entry. 'gm-only' hides it from players; 'observer' lets every player read it; 'owner' lets every player read and edit it. Per-user ownership is kept. |
delete_journal_entry
Permanently delete a journal entry. Use when: the user explicitly asks to remove outdated notes or a handout. Do not use when: only the content, title, folder or visibility needs to change - use update_journal_page, add_journal_page or update_journal_entry instead. DESTRUCTIVE and not undoable from this server: confirm the exact target with the user before calling. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
journalId * | string | The ID of the journal entry to delete |
search_world
Search across all collections (actors, items, scenes, journals) by name, grouped by collection. Use when: you do not know which collection holds what you are looking for. Do not use when: you already know the collection - use search_actors, search_items, or search_journals. Of those, only search_journals prints document ids; for actor and item ids read the foundry://actors and foundry://items resources, each of which lists up to the first 100 documents (not exhaustive in larger worlds).
| Parameter | Type | Description |
|---|---|---|
query * | string | Search query to match against entity names |
limit | number | Maximum results per collection (default 5) |
get_world_summary
Get world metadata (title, game system, core version) and per-collection document counts. Use when: orienting yourself in an unfamiliar world, or confirming the game system before system-specific edits.
refresh_world_data
Force a re-fetch of the cached world data from the FoundryVTT server. Reads are normally served from a cache that follows live document changes for as long as the connection holds, so this is rarely needed. When the connection drops and comes back with the same session, the world is reloaded on its own in the background. Use when: get_health_status still flags the cache as stale (that reload failed, or changes arrived too fast to replay); or a read still looks stale after an out-of-band change. Refreshes the cache only; it does not modify the world.
list_folders
List sidebar folders in the world (id, name, document type, parent folder id, color), optionally filtered by document type (Actor, Item, Scene, JournalEntry, Playlist, RollTable, Cards, Macro, Compendium).
| Parameter | Type | Description |
|---|---|---|
type | string | Optional document type filter (e.g. "Actor", "JournalEntry", "Item") |
list_macros
List Macro documents in the world (id, name, type script/chat, scope, folder, command preview). Use when: discovering available macros or finding a macroId for delete_macro.
list_playlists
List Audio Playlists in the world (id, name, playing state, mode sequential/shuffle/simultaneous, channel, sound track list). Use when: checking background music/ambience state or getting ids for set_playlist_state.
create_folder
Create a new sidebar Folder document to organize actors, items, scenes, journals, playlists, tables, or macros. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
name * | string | Folder display name |
type * | string | Document type this folder contains: "Actor", "Item", "Scene", "JournalEntry", "Playlist", "RollTable", "Cards", "Macro", or "Compendium" |
color | string | Optional folder color as a 6-digit hex string (e.g. "#ff0000") |
parent | string | Optional parent Folder ID for nested folder hierarchies |
sorting | string | Sorting mode: "a" (alphabetical, default) or "m" (manual) |
create_macro
Create a new Macro document (script or chat). Authors and manages the document only — this server has no tool that executes a macro (deliberate security boundary: no arbitrary JS execution in GM browser). WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
command * | string | Macro command content/script body |
name * | string | Macro display name |
type * | string | Macro type: "script" (JavaScript) or "chat" (chat command) |
folder | string | Optional Folder ID to file the macro under |
img | string | Optional icon image path |
scope | string | Macro execution scope (default "global") |
delete_macro
Permanently delete a Macro document from the world. DESTRUCTIVE and not undoable from this server: confirm the exact target with the user before calling. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
macroId * | string | The ID of the macro to delete |
create_playlist
Create a new audio Playlist document with optional starting sound tracks. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
name * | string | Playlist display name |
channel | string | Audio channel (default "music") |
description | string | Optional playlist description |
fade | number | Fade duration in milliseconds |
folder | string | Optional Folder ID to file the playlist under |
mode | number | Playback mode: -1 (soundboard/disabled), 0 (sequential/default), 1 (shuffle), 2 (simultaneous) |
sounds | array | Optional sound tracks to create on this playlist |
set_playlist_state
Start or stop playback of an entire playlist or a specific sound track within it. Drives Foundry playback state; client autoplay policies may affect audio output. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
playing * | boolean | true to start playback, false to stop |
playlistId * | string | The ID of the playlist to control |
soundId | string | Optional PlaylistSound ID to control a specific track instead of the entire playlist |
delete_playlist
Permanently delete an audio Playlist document and its contained sounds. DESTRUCTIVE and not undoable from this server: confirm the exact target with the user before calling. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
playlistId * | string | The ID of the playlist to delete |
set_document_ownership
Configure granular ownership permissions for a document. entries maps user IDs (or "default" for all players) to permission levels: "none" (0), "limited" (1), "observer" (2), "owner" (3). Document types supported: Actor, Item, Scene, JournalEntry, RollTable, Macro. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | 16-char alphanumeric document id |
documentType * | string | Document collection the target lives in |
entries * | array | List of target and ownership level mappings |
list_roll_tables
List the world's roll tables by name, result count, and id. Use when: you need a tableId for roll_table, or want to see what random tables are available. Do not use when: you already have the tableId - go straight to roll_table.
roll_table
Draw a result from a roll table by id, rolling the table's own formula (or a uniform range when it has none) and returning the matched entry. This is a local, read-only draw: unlike FoundryVTT's own table draw, it does not mark the result as drawn or honor a no-duplicates setting, so repeat draws can repeat a result. Use when: rolling on a random encounter, loot, or event table. Do not use when: you don't have a tableId - run list_roll_tables first.
| Parameter | Type | Description |
|---|---|---|
tableId * | string | The ID of the roll table to draw from |
create_roll_table
Create a new RollTable document with text results. Automatically assigns sequential ranges and a matching 1dN formula when ranges are omitted. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
name * | string | Roll table display name |
results * | array | List of text result entries for this table |
description | string | Optional table description |
displayRoll | boolean | Whether the roll total is displayed in chat (default true) |
folder | string | Optional Folder ID to file the table under |
formula | string | Optional custom dice formula (e.g. "1d100" or "2d6") |
replacement | boolean | Whether drawn results are replaced (default true) |
delete_roll_table
Permanently delete a RollTable document from the world. DESTRUCTIVE and not undoable from this server: confirm the exact target with the user before calling. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
tableId * | string | The ID of the roll table to delete |
capture_scene
Screenshot the active scene as seen on the GM's canvas, with a grid coordinate overlay (column,row per cell) burned in for spatial reasoning. Requires the companion Foundry module to be installed, enabled, and connected - fails with a clear error otherwise. Use when: you need to see the current map layout, token positions, or lighting to reason about it. Do not use when: you just need scene metadata (dimensions, darkness) - use get_scene_info, which needs no module.
get_document_schema
Introspect the connected game system's real DataModel schema for an Actor or Item type - the exact field names, types, string-enum choices, and default values that type accepts, read live from the running system. Works with any installed game system. Returns a nested JSON tree: each field has `type` (Number/String/Boolean/Schema/Array/…), `required`, `choices` for constrained strings, and `initial` for its default value; `fields` holds nested sub-fields, `element` describes an array's entries; `persisted: false` marks a computed field that is never stored (writing it has no effect), and `min…
| Parameter | Type | Description |
|---|---|---|
documentType * | string | Which document collection the type belongs to |
type * | string | The Actor or Item type to introspect (e.g. "character", "npc", "weapon") - system-specific; list valid types by trying an obviously-wrong one, or check get_world_summary/the system documentation |
search_compendium_content
Search compendium packs by name and journal entry text content using the browser-rendered Foundry session. Returns pack IDs, document IDs, names, and text snippet matches. Requires the companion Foundry module to be installed, enabled, and connected. Use when: looking up rules or items in compendiums.
| Parameter | Type | Description |
|---|---|---|
limit | number | Maximum number of results to return (default 20) |
packType | string | Optional document type to restrict search to (default "JournalEntry", e.g. "Item", "Actor") |
query | string | Text query to search for across pack names and journal contents |
roll_and_post
Evaluate a dice formula using Foundry's native Roll engine and post it directly to chat as a rendered, clickable roll card. Supports full Foundry dice syntax (e.g. "4d6kh3", "1d20r1", exploding dice) that the local parser rejects. Requires the companion Foundry module. WRITE: changes the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and the companion module, and is refused otherwise; FoundryVTT additionally enforces the GM permission.
| Parameter | Type | Description |
|---|---|---|
formula * | string | Dice formula to evaluate and post (e.g. "4d6kh3" or "2d6 + 5") |
flavor | string | Optional flavor/context text displayed above the roll card |
rollMode | string | Roll visibility mode (default "publicroll") |
speakerAlias | string | Optional custom speaker alias displayed on the chat message |
whisperTo | array | Optional list of User IDs to whisper the roll to privately |
import_compendium_actor
Import a compendium Actor (with its embedded items and effects) as a new top-level world Actor - the gap spawn_token cannot close alone, since it requires an actor that already exists in the world. Best-effort on embedded items: if the game system rejects embedded documents on create, the actor is recreated without them and each item is seeded individually, reporting per-item failures rather than losing the whole import. Requires the companion Foundry module. Use when: adding a creature or NPC from a compendium to the world before spawning its token. Do not use when: the actor already exists i…
| Parameter | Type | Description |
|---|---|---|
actorId * | string | The compendium document's own id, as returned by search_compendium_content |
compendiumId * | string | Compendium pack id the actor lives in (e.g. "world.creatures") |
folderId | string | Optional 16-char Folder document id to file the new world actor under |
name | string | Optional rename for the world actor (default: the compendium name) |
set_target
Set or clear this GM user's target selection on the active canvas (renders the targeting reticle in connected player browsers). tokenIds are token document IDs on the currently viewed scene. Requires the companion Foundry module. Use when: directing player attention, declaring targets, or marking a shared target. WRITE: changes the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and the companion module, and is refused otherwise; FoundryVTT additionally enforces the GM permission.
| Parameter | Type | Description |
|---|---|---|
tokenIds * | array | List of Token IDs on the active canvas to target (or un-target) |
replace | boolean | True to release all existing targets before setting new ones (default: false) |
targeted | boolean | True to target, false to clear target on the given tokens (default: true) |
get_actor_stats
Read the actor's prepared system data, including values the system computes and does not store, as compact JSON. The cached world behind get_actor_details only holds stored data. Give actorId for a world actor, or sceneId + tokenId for one token on a map: a linked token reads its world actor, an unlinked token its own copy (base actor plus the token's changes). paths narrows the answer to some fields; an answer over maxBytes is refused with the size of each top-level key, so you can choose paths. Requires the companion Foundry module 0.6.0 or later. Use when: you need a value the game system d…
| Parameter | Type | Description |
|---|---|---|
actorId | string | The world actor's id. With sceneId + tokenId, optional: it must be the token's actor |
maxBytes | number | Largest answer accepted, in bytes of compact JSON (default 32768, at most 65536) |
paths | array | Optional dot paths into system (a "system." prefix is accepted), at most 50. The answer then holds "values" keyed by path and the "missing" paths instead of the whole "system" |
sceneId | string | Scene of the token to read, together with tokenId |
tokenId | string | Token to read (an unlinked token has its own data), together with sceneId |
get_targets
List the current target selections of all connected users on the active canvas. Returns each user with the tokens they currently have targeted. Requires the companion Foundry module. Use when: checking who players are aiming at or focusing on.
ping_canvas
Emit an animated canvas ping at specific pixel coordinates on the active scene's view, drawing every connected player's camera and attention to that exact location. Requires the companion Foundry module. Use when: pointing out a trap, landmark, or hidden detail on the map. WRITE: changes the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and the companion module, and is refused otherwise; FoundryVTT additionally enforces the GM permission.
| Parameter | Type | Description |
|---|---|---|
x * | number | Pixel x coordinate to ping |
y * | number | Pixel y coordinate to ping |
sceneId | string | Optional scene id (fails if the GM canvas is viewing a different scene) |
set_pause
Pause or unpause the game clock. When paused, token movement and real-time combat timers freeze for players. Requires the companion Foundry module. Use when: stepping away, narrating a long cutscene, or resolving a complex rules question. WRITE: changes the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and the companion module, and is refused otherwise; FoundryVTT additionally enforces the GM permission.
| Parameter | Type | Description |
|---|---|---|
paused | boolean | True to pause, false to unpause (omit to toggle) |
upload_asset
Upload a file (image, audio, etc.) into FoundryVTT's Data storage via the GM browser's FilePicker, returning the Foundry-relative path to feed directly into create_scene (backgroundSrc), create_tile (src), or create_sound (path). Provide exactly one of contentBase64 (base64-encoded file content) or sourcePath (a file inside the folder named by FOUNDRY_UPLOAD_SOURCE_DIR, which the server reads; refused when that setting is unset). Only media files: .png, .jpg, .jpeg, .webp, .gif, .mp3, .ogg, .wav, .m4a, .webm, .mp4, and filename must have the source file's extension. targetDir is a folder relat…
| Parameter | Type | Description |
|---|---|---|
filename * | string | Destination file name with a media extension (e.g. "map.png"), no folder |
targetDir * | string | Destination folder relative to the Data storage (e.g. "assets/uploads"); no ".." and no absolute path |
contentBase64 | string | Base64-encoded file content. Mutually exclusive with sourcePath. |
mimeType | string | Optional MIME type; must be the one of the filename extension, which is used when omitted |
sourcePath | string | Path of a file inside the FOUNDRY_UPLOAD_SOURCE_DIR folder (refused when that setting is unset). Mutually exclusive with contentBase64. |
watch_events
Wait for and return world activity since a cursor - chat messages, token/actor/combat updates, door state changes, user connect/disconnect, and canvas targeting - instead of re-polling get_chat_messages/get_combat_state in a loop. Blocks for up to waitMs (default 25000, max 120000) if nothing has happened yet, returning as soon as something does; pass 0 to check without waiting. Your MCP client's own request timeout must exceed waitMs or the call will appear to fail while still running server-side. Always pass the returned nextCursor back as `cursor` on your next call - it is required to avoid…
| Parameter | Type | Description |
|---|---|---|
actions | array | Restrict to these actions, e.g. ["create","update"] (default: all) |
cursor | string | "now" (default) to start from this moment, "oldest" for the full retained buffer, or a nextCursor value from a previous call |
excludeSelf | boolean | Drop events caused by this server's own account (default true). FoundryVTT does not send a client the broadcast of its own writes, so on v14 the connector's writes never reach the event log and false… |
kinds | array | Restrict to these event kinds (default: all) |
limit | number | Maximum events to return in one call (default 50, max 200) |
sceneId | string | Restrict to events on this scene (default: all scenes) |
types | array | Restrict to these document names, e.g. ["ChatMessage","Token","Combat"] (default: all) |
waitMs | number | Milliseconds to block waiting for a new event before returning empty (default 25000, max 120000, 0 = return immediately) |
create_actor_effect
Create a general-purpose ActiveEffect on an actor with mechanical changes (attribute modifiers) and/or a duration - not just a status toggle (use apply_status_effect for that). Give actorId alone for a world actor, or actorId plus the sceneId+tokenId pair for one token: a linked token writes its world actor, an unlinked token only that token (its own copy of the actor), never the base actor or its other tokens. The token must carry actorId. changes[].mode is a named FoundryVTT ACTIVE_EFFECT_MODES combine rule (add/multiply/override/upgrade/downgrade/custom), not a raw number. Use when: applyin…
| Parameter | Type | Description |
|---|---|---|
actorId * | string | The actor's own document id |
name * | string | Effect display name |
changes | array | Mechanical changes this effect applies |
description | string | Optional effect description text |
disabled | boolean | Create the effect already disabled (default false) |
duration | object | Optional effect duration |
img | string | Optional icon image path |
sceneId | string | Scene id, required together with tokenId for an unlinked token actor |
statuses | array | Optional status condition ids this effect also represents |
tokenId | string | Token id, required together with sceneId for an unlinked token actor |
update_actor_effect
Update fields on an existing ActiveEffect - every field replaces the corresponding one on the existing document, omitted fields are left as they are. Same actorId/sceneId+tokenId resolution as create_actor_effect: on an unlinked token only that token changes, even for an effect it inherits from its base actor. Use when: a buff's remaining duration changes, or its magnitude scales. Do not use when: the effect should end - use delete_actor_effect. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Found…
| Parameter | Type | Description |
|---|---|---|
actorId * | string | The actor's own document id |
effectId * | string | The ActiveEffect document id to update |
changes | array | Replacement mechanical changes |
description | string | New effect description text |
disabled | boolean | Enable/disable the effect |
duration | object | Replacement effect duration |
img | string | New icon image path |
name | string | New effect display name |
sceneId | string | Scene id, required together with tokenId for an unlinked token actor |
statuses | array | Replacement status condition ids |
tokenId | string | Token id, required together with sceneId for an unlinked token actor |
delete_actor_effect
Delete an ActiveEffect from an actor. Same actorId/sceneId+tokenId resolution as create_actor_effect: on an unlinked token only that token loses the effect, even one it inherits from its base actor. DESTRUCTIVE and not undoable from this server: confirm the exact target with the user before calling. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
actorId * | string | The actor's own document id |
effectId * | string | The ActiveEffect document id to delete |
sceneId | string | Scene id, required together with tokenId for an unlinked token actor |
tokenId | string | Token id, required together with sceneId for an unlinked token actor |
list_actor_effects
List the ActiveEffects on an actor, read from the cached world snapshot (no socket round trip). Give actorId for a world actor, or sceneId + tokenId for one token: an unlinked token lists its own effects (those it inherits from its base actor and its own, without the ones removed from it), a linked token its world actor's. Use when: checking what buffs/debuffs are currently active on an actor before applying another.
| Parameter | Type | Description |
|---|---|---|
actorId | string | The actor's own document id (omit when giving sceneId + tokenId) |
sceneId | string | Scene id of the token, required together with tokenId |
tokenId | string | Token id: lists the effects of that token's own actor (base actor and the token's changes merged, for an unlinked token) instead of actorId |
list_regions
List the Scene Regions placed on a scene (FoundryVTT v12+). Regions are polygon/circle/rectangle areas that trigger behaviors when tokens enter, move through, or leave them. Use when: inspecting traps, teleport pads, atmospheric zones, or scripted triggers on a map.
| Parameter | Type | Description |
|---|---|---|
sceneId | string | Optional scene id; defaults to the currently active scene |
create_region
Create a new Scene Region with shapes and/or automated behaviors (FoundryVTT v12+). Shapes use pixel coordinates (use get_scene_info/find_open_cells to convert from grid cells). Documented behaviors include teleportToken ({ destination: <region UUID> }), displayScrollingText ({ text, color, visibility }), adjustDarknessLevel ({ mode, modifier }), and pauseGame ({ once }); custom system/module behavior types pass through untouched. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally…
| Parameter | Type | Description |
|---|---|---|
name * | string | Region display name |
behaviors | array | Automated behaviors triggered when tokens interact with the region |
color | string | Optional 6-digit hex color for canvas rendering (e.g. "#ff8800") |
elevation | object | Optional 3D vertical bounds (null for unbounded) |
sceneId | string | Optional scene id; defaults to the currently active scene |
shapes | array | Pixel-coordinate geometric shapes defining the region boundary |
visibility | number | 0 = hidden from players, 1 = visible to players (default: 0) |
delete_region
Delete a Scene Region from a scene (FoundryVTT v12+). DESTRUCTIVE and not undoable from this server: confirm the exact target with the user before calling. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
regionId * | string | The Region document id to delete |
sceneId | string | Optional scene id; defaults to the currently active scene |
generate_npc
Generate a random fantasy-style NPC as text, from built-in lists that do not depend on the game system of the world (name, people, profession, hit points, ability values, background). Use when: the user needs a throwaway NPC on the spot. Do not use when: the NPC must exist in FoundryVTT - this creates no documents, and the result still has to be entered into the world by hand.
| Parameter | Type | Description |
|---|---|---|
class | string | Character class (optional) |
level | number | Character level (1-20) |
race | string | Character race (optional) |
generate_loot
Generate random fantasy-style treasure for an encounter as text, from built-in tables that do not depend on the game system of the world. Only the coin amounts vary: they scale with challengeRating, while the item list is fixed (a healing potion and a silver ring) and the treasureType argument is accepted but not used. Use when: the user wants a quick coin total for an encounter. Do not use when: the loot should end up in an actor's inventory - this creates no documents; use create_actor_item for that.
| Parameter | Type | Description |
|---|---|---|
challengeRating | number | Difficulty of the encounter; the coin amounts scale with it |
treasureType | string | Type of treasure (hoard, individual, etc.). Accepted but not used - the generated result is the same whichever value is passed. |
lookup_rule
Search rules and mechanics across world journals and compendium journal packs. Compendium search requires the companion Foundry module.
| Parameter | Type | Description |
|---|---|---|
query * | string | Rule, keyword, or mechanic to look up |
get_world_setting
Read a world setting by its namespaced key (e.g. "my-module.customSetting" or "simple-calendar.year"). If the setting has never been modified from its system/module default, exists will be false. Use when: inspecting world configuration.
| Parameter | Type | Description |
|---|---|---|
key * | string | The namespaced setting key in the format {scope}.{field} |
set_world_setting
Update or create a world setting value for a system or module namespace (e.g. "my-module.settingName"). Refuses writes to the "core.*" namespace (core settings control the Foundry client itself and can break the world; change those in the UI). DESTRUCTIVE and not undoable from this server: confirm the exact target with the user before calling. WRITE: mutates the live world. Requires FOUNDRY_WRITE_ENABLED=true (default false) and an active Socket.IO connection, and is refused otherwise; Foundry additionally enforces GM/owner permission on the document.
| Parameter | Type | Description |
|---|---|---|
key * | string | The namespaced setting key in the format {scope}.{field} (non-core only) |
value * | The value to store (JSON-serializable: string, number, boolean, object, or array) |
get_recent_logs
Get recent FoundryVTT server log entries, optionally filtered by level or since a timestamp. Use when: investigating an error or recent server behaviour. Do not use when: you have a specific term to look for - use search_logs. Requires the REST API module (FOUNDRY_API_KEY); fails without it.
| Parameter | Type | Description |
|---|---|---|
level | string | Log level filter (debug, info, warn, error) |
limit | number | Number of log entries to retrieve |
since | string | Get logs since this timestamp (ISO format) |
search_logs
Search the FoundryVTT server logs for a query string and list the matching entries. Use when: hunting a specific error message, stack trace, or module name. Do not use when: you just want the latest entries - use get_recent_logs. The reported match count is the server's total for the query, while limit caps how many of those entries are rendered (default 50, hard cap 1000). Level filtering accepts info, warn and error; "debug" is not a level this log store records, so it is reported back as unsupported and no level filter is applied. Requires the REST API module (FOUNDRY_API_KEY); fails withou…
| Parameter | Type | Description |
|---|---|---|
query * | string | Search query for log contents |
level | string | Log level filter; "debug" is not recorded by this log store and is not applied |
limit | number | Maximum number of matched entries to render (capped at 1000) |
get_system_health
Get the FoundryVTT server's health report: the overall status (healthy, warning, or critical), FoundryVTT and game-system versions, world id and uptime, active/total user counts with the number of GMs, active/installed module counts, connected clients, heap and RSS memory, and the log buffer size with recent error/warning counts and error rate. CPU and disk are not reported - the diagnostics response models no such fields - and the uptime and memory lines are omitted when the server does not supply them. Use when: you want the server's own view of its health. Do not use when: you also want con…
diagnose_errors
Retrieve error diagnosis and health analysis from the FoundryVTT server logs via the REST API module (FOUNDRY_API_KEY). Reports error categories, health score, actionable suggestions, and recent errors.
| Parameter | Type | Description |
|---|---|---|
category | string | Optional error category to filter summary and logs (e.g. "socket", "database") |
timeframe | number | Timeframe in seconds to analyze (default 3600) |
get_health_status
Get a combined health report: MCP-to-FoundryVTT connection state, world title/system/core version, and the server's health status with its active/total user counts, uptime, heap memory and recent error/warning counts. The world section is prefixed with a stale marker when the cached snapshot stopped following live document changes - typically a dropped connection, until the world is reloaded once it comes back (on its own, or with refresh_world_data). The connection line is a live read of the socket on the default Socket.IO transport, so it follows a link that drops or comes back in both direc…