{
  "schema_version": "1.0",
  "name": "moddable-tools",
  "description": "AI-callable tools for chess variant analysis, hex map generation, and board game utilities",
  "url": "https://tools.moddable.games/mcp",
  "transport": "sse",
  "tools": [
    {
      "name": "chess_list_variants",
      "description": "List all available chess variants with their descriptions, board sizes, and rules.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "group": {
            "type": "string",
            "description": "Filter by group name (Classic, Tactical, Alternate Rules, Asymmetric, Small Boards, Large Boards). Omit for all."
          }
        }
      }
    },
    {
      "name": "chess_get_legal_moves",
      "description": "Get all legal moves for the current position. Returns moves in algebraic notation with annotations (capture, promotion, castling, etc).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "variant": {
            "type": "string",
            "description": "Variant key (e.g. \"standard\", \"atomic\", \"capablanca\"). Defaults to \"standard\"."
          },
          "fen": {
            "type": "string",
            "description": "FEN string of the position. Omit to use the variant starting position."
          }
        }
      }
    },
    {
      "name": "chess_analyze_position",
      "description": "Evaluate a chess position using the engine. Returns a score (centipawns from the side to move), best move, and the principal variation.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "variant": {
            "type": "string",
            "description": "Variant key. Defaults to \"standard\"."
          },
          "fen": {
            "type": "string",
            "description": "FEN string. Omit for starting position."
          },
          "depth": {
            "type": "number",
            "description": "Search depth (1-6). Higher is slower but more accurate. Defaults to 4."
          }
        }
      }
    },
    {
      "name": "chess_validate_move",
      "description": "Check whether a specific move is legal in the current position. Returns legal/illegal with explanation.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "variant": {
            "type": "string",
            "description": "Variant key. Defaults to \"standard\"."
          },
          "fen": {
            "type": "string",
            "description": "FEN string. Omit for starting position."
          },
          "move": {
            "type": "string",
            "description": "Move in coordinate notation (e.g. \"e2e4\", \"e7e8q\" for promotion)."
          }
        },
        "required": [
          "move"
        ]
      }
    },
    {
      "name": "chess_make_moves",
      "description": "Play a sequence of moves from a position and return the resulting FEN, game status, and move list.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "variant": {
            "type": "string",
            "description": "Variant key. Defaults to \"standard\"."
          },
          "fen": {
            "type": "string",
            "description": "Starting FEN. Omit for variant start position."
          },
          "moves": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Moves in coordinate notation (e.g. [\"e2e4\", \"e7e5\", \"g1f3\"])."
          }
        },
        "required": [
          "moves"
        ]
      }
    },
    {
      "name": "chess_get_opening_book",
      "description": "Look up opening book moves for a position. Returns known good continuations from the variant opening book.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "variant": {
            "type": "string",
            "description": "Variant key. Defaults to \"standard\"."
          },
          "fen": {
            "type": "string",
            "description": "FEN string. Omit for starting position."
          }
        }
      }
    },
    {
      "name": "chess_generate_puzzle",
      "description": "Generate a chess puzzle (mate-in-N or tactical sequence). Returns a FEN position and the solution moves.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "variant": {
            "type": "string",
            "description": "Variant key. Defaults to \"standard\"."
          },
          "type": {
            "type": "string",
            "enum": [
              "mate-in-1",
              "mate-in-2",
              "tactics"
            ],
            "description": "Puzzle type. Defaults to \"mate-in-1\"."
          }
        }
      }
    },
    {
      "name": "hex_list_games",
      "description": "List all available hex map games with their map types, layouts, sizes, and style options.",
      "inputSchema": {
        "type": "object",
        "properties": {}
      }
    },
    {
      "name": "hex_generate_map",
      "description": "Generate a hex map for a given game. Returns the full hex grid with terrain types, coordinates, and metadata.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "game": {
            "type": "string",
            "description": "Game key (e.g. \"nukes\", \"colony\", \"twilight\", \"talisman\", \"mongo\", \"endless\")."
          },
          "seed": {
            "type": "string",
            "description": "Seed string for reproducible generation. Omit for a default seed."
          },
          "size": {
            "type": "number",
            "description": "Map size (ring count). Meaning varies by game. Omit for the game default."
          },
          "players": {
            "type": "number",
            "description": "Player count. Omit or 0 for no player bases."
          },
          "layout": {
            "type": "string",
            "description": "Layout variant (e.g. \"standard\", \"expanded\", \"6p\"). Only for games with multiple layouts."
          }
        },
        "required": [
          "game"
        ]
      }
    },
    {
      "name": "hex_get_info",
      "description": "Get detailed information about a specific hex coordinate on a generated map: terrain type, neighbors, and distances to other hexes.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "game": {
            "type": "string",
            "description": "Game key."
          },
          "seed": {
            "type": "string",
            "description": "Seed used to generate the map."
          },
          "size": {
            "type": "number",
            "description": "Map size."
          },
          "players": {
            "type": "number",
            "description": "Player count."
          },
          "layout": {
            "type": "string",
            "description": "Layout variant."
          },
          "q": {
            "type": "number",
            "description": "Axial q coordinate of the target hex."
          },
          "r": {
            "type": "number",
            "description": "Axial r coordinate of the target hex."
          }
        },
        "required": [
          "game",
          "q",
          "r"
        ]
      }
    },
    {
      "name": "hex_compute_fov",
      "description": "Compute field-of-view from a hex position: all hexes visible within a given range, respecting line-of-sight through the grid.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "game": {
            "type": "string",
            "description": "Game key."
          },
          "seed": {
            "type": "string",
            "description": "Seed used to generate the map."
          },
          "size": {
            "type": "number",
            "description": "Map size."
          },
          "players": {
            "type": "number",
            "description": "Player count."
          },
          "layout": {
            "type": "string",
            "description": "Layout variant."
          },
          "q": {
            "type": "number",
            "description": "Axial q coordinate of the observer."
          },
          "r": {
            "type": "number",
            "description": "Axial r coordinate of the observer."
          },
          "range": {
            "type": "number",
            "description": "Vision range in hex steps (default 3)."
          },
          "blocking": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Terrain types that block line of sight (e.g. [\"mount\", \"mountains\"]). Defaults to none."
          }
        },
        "required": [
          "game",
          "q",
          "r"
        ]
      }
    },
    {
      "name": "hex_export_svg",
      "description": "Export a generated hex map as an SVG string for rendering or embedding.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "game": {
            "type": "string",
            "description": "Game key."
          },
          "seed": {
            "type": "string",
            "description": "Seed used to generate the map."
          },
          "size": {
            "type": "number",
            "description": "Map size."
          },
          "players": {
            "type": "number",
            "description": "Player count."
          },
          "layout": {
            "type": "string",
            "description": "Layout variant."
          },
          "hexSize": {
            "type": "number",
            "description": "Hex radius in pixels (default from game config)."
          },
          "labels": {
            "type": "boolean",
            "description": "Show terrain labels on hexes (default false)."
          },
          "bgColor": {
            "type": "string",
            "description": "Background colour (e.g. \"#1a1a2e\"). Omit for transparent."
          }
        },
        "required": [
          "game"
        ]
      }
    },
    {
      "name": "hex_pathfind",
      "description": "Find the shortest path between two hexes on a generated map using breadth-first search. Optionally specify impassable terrain types.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "game": {
            "type": "string",
            "description": "Game key."
          },
          "seed": {
            "type": "string",
            "description": "Seed used to generate the map."
          },
          "size": {
            "type": "number",
            "description": "Map size."
          },
          "players": {
            "type": "number",
            "description": "Player count."
          },
          "layout": {
            "type": "string",
            "description": "Layout variant."
          },
          "fromQ": {
            "type": "number",
            "description": "Start hex axial q."
          },
          "fromR": {
            "type": "number",
            "description": "Start hex axial r."
          },
          "toQ": {
            "type": "number",
            "description": "End hex axial q."
          },
          "toR": {
            "type": "number",
            "description": "End hex axial r."
          },
          "impassable": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Terrain types that cannot be traversed (e.g. [\"water\", \"mount\"]). Defaults to none."
          }
        },
        "required": [
          "game",
          "fromQ",
          "fromR",
          "toQ",
          "toR"
        ]
      }
    },
    {
      "name": "dice_roll",
      "description": "Roll dice using standard notation (e.g. \"2d6+3\", \"4d8-1\", \"d20\"). Supports any combination of dice, modifiers, and multiple pools.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "notation": {
            "type": "string",
            "description": "Dice notation (e.g. \"2d6+3\", \"4d8\", \"d20+5\", \"3d6\"). Multiple pools separated by commas."
          }
        },
        "required": [
          "notation"
        ]
      }
    },
    {
      "name": "ti4_random_factions",
      "description": "Generate random faction assignments for a Twilight Imperium 4e game. Supports base game and Prophecy of Kings expansion.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "players": {
            "type": "number",
            "description": "Number of players (3-8). Defaults to 6."
          },
          "expansion": {
            "type": "string",
            "enum": [
              "base",
              "pok"
            ],
            "description": "Include Prophecy of Kings factions. Defaults to \"pok\"."
          }
        }
      }
    }
  ],
  "prompts": [
    {
      "name": "analyse_position",
      "description": "Analyse a chess position given in FEN notation. Identifies threats, material balance, and suggests best moves for the side to play.",
      "arguments": [
        {
          "name": "fen",
          "description": "FEN string of the position to analyse",
          "required": true
        },
        {
          "name": "variant",
          "description": "Chess variant name (default: standard)",
          "required": false
        }
      ]
    },
    {
      "name": "build_variant",
      "description": "Design a new chess variant step by step. Guides through board size, piece types, win conditions, and special rules.",
      "arguments": [
        {
          "name": "theme",
          "description": "Theme or concept for the variant (e.g. \"fast-paced\", \"asymmetric\", \"3-player\")",
          "required": true
        }
      ]
    },
    {
      "name": "plan_hex_map",
      "description": "Plan a hex map layout for a board game. Determines grid size, terrain distribution, and resource placement based on player count and game type.",
      "arguments": [
        {
          "name": "players",
          "description": "Number of players (2-8)",
          "required": true
        },
        {
          "name": "game",
          "description": "Game system (e.g. \"nukes\", \"talisman\", \"ti4\", \"custom\")",
          "required": false
        }
      ]
    }
  ],
  "resources": [
    {
      "uri": "tools://moddable-games/variants",
      "name": "Chess Variants Catalog",
      "description": "Complete list of all 70+ supported chess variants with group classifications",
      "mimeType": "application/json"
    },
    {
      "uri": "tools://moddable-games/tools",
      "name": "Tool Catalog",
      "description": "Full listing of all available tools with input schemas and descriptions",
      "mimeType": "application/json"
    },
    {
      "uri": "tools://moddable-games/ti4-factions",
      "name": "TI4 Faction List",
      "description": "All Twilight Imperium 4e factions (base + Prophecy of Kings expansion)",
      "mimeType": "application/json"
    }
  ],
  "configSchema": {
    "type": "object",
    "properties": {},
    "additionalProperties": false,
    "description": "No configuration required. All tools are free and open, no API keys needed."
  }
}