MODDABLE.GAMES

Tools API

89 AI-callable tools across 30 playable families (313 variants). Board game play, hex map generation, puzzles, RPG oracles, and more. Connect from any MCP client or call via REST.

claude mcp add --transport http moddable-tools https://tools.moddable.games/mcp
89
MCP tools
35
REST endpoints
30
game families
313
playable variants
46
games
125
piece sets
335
boards
1,849
puzzles
ENDPOINTS

Connect however you want

POST /mcp/messageMCP protocol (JSON-RPC 2025-03-26)
GET /mcpMCP server-sent events (SSE)
POST /api/callREST API — {"tool": "name", "args": {...}}
GET /api/toolsList all tools with input schemas
GET /helpFull API reference (JSON) with all params
GET /help/:toolDetailed docs + curl example for a specific tool
GET /llms.txtAI-readable discovery file
GET /openapi.jsonOpenAPI 3.1 specification
RENDER (PNG)

Visual assets — boards, pieces, tiles as images

GET /api/board.pngRender board — ?fen=...&variant=... or ?board={id}&size=480
GET /api/piece.pngSingle piece — ?set=chessnut&piece=wK&size=128
GET /api/pieces.pngAll pieces in set — ?set=chessnut&size=64 (grid)
GET /api/tile.pngSingle tile — ?set=nukes&tile=grass&size=256
GET /api/tiles.pngAll tiles in set — ?set=nukes&size=128 (grid)
QUICK START
curl -X POST https://tools.moddable.games/api/call \
  -H "Content-Type: application/json" \
  -d '{"tool": "play_create_game", "args": {"family": "chess", "variant": "atomic"}}'
CHESS ENGINE · 11 TOOLS

Chess puzzles: randomised positions filtered by difficulty and theme from the puzzle pool

chess_generate_puzzle
Get a random chess puzzle. Filter by variant, difficulty or theme. Not every variant puzzle carries themes; use chess_list_puzzle_types to see what the pool holds.
chess_list_puzzle_types
List available puzzle variants, themes, and per-variant counts from the puzzle pool
chess_list_variants
[DEPRECATED — use play_list_variants] List chess variants. Removal: v1.0.0.
chess_get_legal_moves
[DEPRECATED — use play_create_game + play_get_moves] Get legal moves for a chess position. Removal: v1.0.0.
chess_analyze_position
[DEPRECATED — use play_suggest_move] Analyse a chess position. Removal: v1.0.0.
chess_make_move
[DEPRECATED — use play_apply_move] Apply a move to a chess game. Removal: v1.0.0.
chess_validate_move
[DEPRECATED — use play_validate_move] Check if a chess move is legal. Removal: v1.0.0.
chess_get_status
[DEPRECATED — use play_check_status] Get chess game status. Removal: v1.0.0.
chess_render_svg
[DEPRECATED — use play_render_board] Render a chess position as SVG. Removal: v1.0.0.
chess_make_moves
[DEPRECATED — use play_make_moves] Apply a sequence of chess moves. Removal: v1.0.0.
chess_get_opening_book
[REMOVED — engine#98] Opening book resolution is broken in Worker context. No replacement.
HEX MAPS · 6 TOOLS

Procedural map generation for 6 strategy games with field-of-view, pathfinding, and SVG export

hex_list_games
List all available hex map game types with configuration options
hex_generate_map
Generate a hex map for a specific game and player count
hex_export_svg
Generate a hex map and export as SVG
hex_get_info
Get info about a specific hex coordinate (terrain, neighbours, distance)
hex_compute_fov
Compute field of view from a hex position
hex_pathfind
Find shortest path between two hex coordinates
UNIVERSAL PLAY · 13 TOOLS

30 game families via universal interface: start, move, check status, get AI recommendations

play_list_families
List all playable game families supported by the engine (chess, draughts, go, reversi, shogi, xiangqi, mancala, morris, hex, landlords-game, backgammon, standard-52, bavarian-32, flower-48, double-six-dominoes, mahjong, standard-dice, agon, asalto, chaupar, dou-shou-qi, fanorona, halma, nyout, pachisi, royal-ur, senet, stern-halma, surakarta, tafl)
play_list_variants
List available variants for a game family. Each variant can be passed to play_create_game. Variants with flags (e.g. +random) can be requested as "slug+flag".
play_get_definition
Get the full engine definition (topology, render config, pieces, setup FEN) for a game variant. Returns the resolved frontmatter used to render and play the game.
play_create_game
Create a new game instance for a given family. Returns initial state to pass to subsequent calls. Variant can include flags like "grand+random" or "standard+drops".
play_get_moves
Get all legal moves for the current position. Requires state from play_create_game or play_apply_move.
play_apply_move
Apply a move to the game and return the new state. Pass the move object exactly as returned by play_get_moves (format varies by family: chess uses {from,to}, go uses {coord} or {action:"pass"}).
play_check_status
Check the current game status: whose turn it is, whether the game is over, and who won.
play_suggest_move
Use AI to analyse the position and suggest the best move. Supports 5 difficulty levels across all 30 playable families.
play_render_board
Render the current board position as SVG for any playable family (chess, draughts, go, reversi, shogi, xiangqi, mancala, morris, hex, landlords-game, backgammon, standard-52, bavarian-32, flower-48, double-six-dominoes, mahjong, standard-dice, agon, asalto, chaupar, dou-shou-qi, fanorona, halma, nyout, pachisi, royal-ur, senet, stern-halma, surakarta, tafl).
play_export_fen
Export the current board position as a FEN-style setup string, in the form the variant's own frontmatter declares its starting position. Card, tile and dice games have no board position to export.
play_load_fen
Create a game from a FEN-style setup string, as returned by play_export_fen. Pass the same variant the position was exported from.
play_validate_move
Check whether a move is legal in the current position without applying it. Pass the move object in the same format as play_get_moves returns.
play_make_moves
Apply a sequence of moves to a game and return the final state. Stops at the first illegal move. Move objects must match play_get_moves format.
RULES LIBRARY · 9 TOOLS

Full-text search across 46 game rulebooks with variant rules in markdown

rules_list_games
List all available game rulebooks with metadata (players, duration, complexity, mechanics). Filterable by type, complexity, and mechanics.
rules_get_game
Get full rulebook content for a specific game (markdown). For metadata only, use rules_get_game_meta instead.
rules_get_game_meta
Get structured metadata for a game: players, duration, complexity, mechanics, how_to_play, variant list, page list, related games. Lightweight alternative to fetching the full rulebook.
rules_get_page
Get a specific page/section from a game rulebook (e.g. character creation, combat rules, marketplace). Use rules_get_game_meta to see available pages.
rules_get_variant_list
List all variants for a game with structured metadata (players, board, playable status, topology, engine config). Much richer than parsing the rulebook.
rules_get_diagram
Get board diagram SVG URL for a game variant. Returns the diagram path, topology, and rendering metadata.
rules_get_variant
Get rules for a specific game variant
rules_search
Full-text search across all published rulebooks. Returns section-typed results with deep-link anchors.
rules_random
Get a random game suggestion from the library
ORACLES & RPG · 17 TOOLS

10 RPG systems: oracle tables, scene recipes, character generation, encounter building, 3,385 entities

oracle_list_games
List all supported RPG systems with oracle tables and entity data availability
rpg_chargen
Generate a random character for an RPG system (D&D 5e, Pathfinder, Ironsworn, Cairn, Knave, etc)
oracle_roll
Roll on a random oracle table (Ironsworn, Starforged, Maze Rats, etc)
oracle_list_tables
List available oracle tables for a system
oracle_ask
Ask the oracle a yes/no question with likelihood modifier
oracle_scene
Generate a scene using oracle tables. With a recipe, rolls each table in the recipe, resolves cross-references, and composes a narrative sentence. Without, picks random tables.
rpg_search_entities
Search RPG entities (spells, monsters, classes, items) across all systems
rpg_get_entity
Get full details of a specific RPG entity by name
rpg_random_encounter
Generate a random encounter for a system and difficulty level
rpg_browse_category
Browse entities by category with pagination
rpg_loot
Generate random loot/treasure for a system and tier
oracle_list_recipes
List all predefined scene recipes — curated multi-table compositions that produce coherent narrative prompts
oracle_interpret
Resolve oracle cross-references. Given a result like "Action + Theme", follows references and returns expanded results
oracle_table_view
View the complete contents of an oracle table — all entries with roll ranges
oracle_encounter
Generate a tabletop RPG encounter with CR-appropriate monsters, terrain, and loot (D&D 5e or Pathfinder 1e)
rpg_list_categories
List entity categories for an RPG system (spells, monsters, classes, equipment, etc)
rpg_random
Get random entities from an RPG system for inspiration or encounter prep
GAME SESSIONS · 17 TOOLS

TI4 faction drafting and objectives, Nukes setup, Colony odds, card decks (6 types), and Mod Jam

ti4_random_factions
Generate random faction assignments for Twilight Imperium 4th Edition
ti4_draft_factions
Milty-style TI4 draft with pick pools per player
ti4_list_factions
List all TI4 factions with colors, flags, and expansion info
ti4_draw_objectives
Draw random public objectives for TI4
ti4_draw_agendas
Draw random agenda cards for TI4 political phase
nukes_setup_generator
Generate random territory/resource setup for a Nukes game
game_nukes_combat
Resolve a Nukes combat encounter between units
colony_dice_odds
Calculate settlement dice probability for Colony/Catan-style resource numbers
game_deck_create
Create, shuffle, and optionally draw/deal from a card deck
game_deck_list_types
List all available deck types with metadata
game_deck_deal
Shuffle and deal a custom deck of arbitrary named cards
game_score_tracker
Track scores for players in any game
talisman_draw_characters
Draw random characters from the Talisman 4e (revised) base set for a character lottery
talisman_draw_encounter
Draw a random encounter for a Talisman ring (outer, middle, inner, crown)
jam_status
Get the current Mod Jam status (active jam, deadline, submissions)
jam_timer
Get time remaining in the current Mod Jam
jam_vote
Get voting status for the current Mod Jam
UTILITIES · 7 TOOLS

Dice with probability maths, coin flip, team split, turn order, timer suggestions

dice_roll
Roll dice using standard notation (e.g. 2d6+3, 4d8, d20). Supports comma-separated pools and keep-high/low (4d6kh3).
coin_flip
Flip one or more coins, or pick from a list of choices
team_split
Randomly divide players into teams
random_player_order
Randomise turn order for a list of players
timer_suggest
Suggest time controls for a game based on player count and complexity
game_jam_theme
Generate a random game jam theme combining mechanics and themes
dice_odds
Calculate probability of meeting a target with a dice expression. Supports keep-high/low (4d6kh3).
MIGRATION

Chess tools → Generic play tools (30 families, 313 variants)

Eight chess-only tools have been replaced by family-generic equivalents. Deprecated names still work but will be removed in v1.0.0.

DeprecatedReplacement
chess_list_variantsplay_list_variants
chess_get_legal_movesplay_create_game + play_get_moves
chess_analyze_positionplay_suggest_move
chess_make_moveplay_apply_move
chess_validate_moveplay_validate_move
chess_get_statusplay_check_status
chess_render_svgplay_render_board
chess_make_movesplay_make_moves
chess_get_opening_bookRemoved (engine#98)
ECOSYSTEM

Static APIs consumed by this service

engine.moddable.games/api/pieces/index.json125 piece sets (SVG) across chess, shogi, xiangqi, Go, draughts, backgammon
engine.moddable.games/api/boards/index.json335 board layouts (SVG) spanning 34 game families
engine.moddable.games/api/tiles/index.json11 hex tile sets (PNG) for strategy maps
engine.moddable.games/api/puzzles/index.json1,849 chess puzzles with FEN, solutions, and difficulty ratings
rules.moddable.games/api/catalogue.json46 games, 296 variants, 177 pages of rules in markdown
rules.moddable.games/api/oracles.json458 oracle tables across 6 RPG systems
rules.moddable.games/api/entities.json3,385+ RPG entities (monsters, spells, items) across 10 systems
rules.moddable.games/api/search-index.jsonFull-text search index across all published rulebooks
EMBEDDABLE WIDGETS

Drop interactive tools into any page — fully customizable via CSS and postMessage

GET /embed/diceDice Lab — 9 wargame simulators (40K, Risk, TI4, A&A, X-Wing, Blood Bowl, Memoir, Custom)
GET /embed/ti4TI4 Tools — faction draft picker + agenda voter with vote tracking
GET /embed/decksCard Decks — shuffle and deal from 6 deck types (standard, hanafuda, mahjong, dominoes...)
GET /embed/talismanTalisman Tools — character lottery + encounter quick-draw for any ring
GET /embed/nukesNukes Tools — combat strength calculator + hostage tracker + unit reference
GET /embed/oraclesOracle Tools — scene forge, table roller, yes/no oracle, thread weaver, encounter builder, RPG library
<iframe src="https://tools.moddable.games/embed/dice?tab=risk"
        width="100%" height="600" style="border:none"></iframe>

// Or with theming via URL params:
/embed/dice?tab=roller&vars={"--embed-bg":"#1a1a2e","--embed-text":"#eee"}

// Or control programmatically via postMessage:
iframe.postMessage({ type: 'moddable:setTab', tab: 'ti4' }, '*')
iframe.postMessage({ type: 'moddable:config', vars: {'--embed-accent':'#ff0'} }, '*')
CLIENT SDK (@moddable/tools-sdk)

One import — API calls, render URLs, and managed embeds with auto-resize

import { ModdableTools } from '@moddable/tools-sdk'
const tools = new ModdableTools({ base: 'https://tools.moddable.games' })

// API calls
const result = await tools.utilities.diceRoll({ notation: '4d6kh3' })
const factions = await tools.games.ti4DraftFactions({ players: 6, hand_size: 3 })

// Managed embeds (auto-resize, theming, event hooks)
const widget = tools.embed.dice('#mount-point', {
  tab: 'risk',
  vars: { '--embed-bg': '#0a0d2a', '--embed-text': '#eee' },
  onResult: (tool, data) => console.log(data),
  onResize: (height) => console.log('height:', height),
})
widget.setTab('ti4')    // switch tab
widget.setVars({...})   // retheme
widget.destroy()        // teardown

// Render URLs (for <img> tags)
const boardUrl = tools.render.boardUrl({ variant: 'chess960', fen: '...' })