@dimcool/mcp 0.1.11 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +32 -16
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -25787,7 +25787,7 @@ import { z as z5 } from "zod";
25787
25787
  function registerGamesTools(server2, client) {
25788
25788
  server2.tool(
25789
25789
  "dim_list_games",
25790
- "List all available game types on DIM with player counts and descriptions. Games include: Rock-Paper-Scissors, Chess, Tic-Tac-Toe, Connect Four, Nim, Dots and Boxes.",
25790
+ "List all available game types on DIM with player counts and descriptions. Games include: Rock-Paper-Scissors, Chess, Tic-Tac-Toe, Connect Four.",
25791
25791
  {},
25792
25792
  async () => {
25793
25793
  try {
@@ -25833,18 +25833,19 @@ function registerGamesTools(server2, client) {
25833
25833
  );
25834
25834
  server2.tool(
25835
25835
  "dim_create_lobby",
25836
- "Create a new game lobby. The agent becomes the lobby creator. Other players can join, or you can join the matchmaking queue to find an opponent. Bet amount is in USDC minor units (1 USDC = 1,000,000). A 1% fee (min 1 cent) is charged per player.",
25836
+ "Create a new game lobby. The agent becomes the lobby creator. Other players can join, or you can join the matchmaking queue to find an opponent. Bet amount is in USDC dollars (e.g., 1.00 for $1.00). A 1% fee (min 1 cent) is charged per player.",
25837
25837
  {
25838
25838
  gameType: z5.string().describe(
25839
- 'Game type ID (e.g., "rock-paper-scissors", "chess", "tic-tac-toe", "connect-four", "nim", "dots-and-boxes")'
25839
+ 'Game type ID (e.g., "rock-paper-scissors", "chess", "tic-tac-toe", "connect-four")'
25840
25840
  ),
25841
25841
  betAmount: z5.number().optional().describe(
25842
- "Bet amount in USDC minor units (e.g., 1000000 = $1.00). Common amounts: 1000000 ($1), 5000000 ($5), 10000000 ($10)"
25842
+ "Bet amount in USDC dollars (e.g., 1.00 for $1.00, 5.00 for $5.00, 10.00 for $10.00)"
25843
25843
  )
25844
25844
  },
25845
25845
  async ({ gameType, betAmount }) => {
25846
25846
  try {
25847
- const lobby = await client.sdk.lobbies.createLobby(gameType, betAmount);
25847
+ const betMinor = betAmount != null ? Math.round(betAmount * 1e6) : void 0;
25848
+ const lobby = await client.sdk.lobbies.createLobby(gameType, betMinor);
25848
25849
  return {
25849
25850
  content: [
25850
25851
  {
@@ -25973,24 +25974,23 @@ function registerGamesTools(server2, client) {
25973
25974
  );
25974
25975
  server2.tool(
25975
25976
  "dim_submit_action",
25976
- 'Submit a game action. The action format depends on the game type.\n\nRock-Paper-Scissors: gameType="rock-paper-scissors", action="play", payload={ action: "rock"|"paper"|"scissors" }\nChess: gameType="chess", action="move", payload={ from: "e2", to: "e4" }\nTic-Tac-Toe: gameType="tic-tac-toe", action="place", payload={ position: 0-8 }\nConnect Four: gameType="connect-four", action="drop", payload={ column: 0-6 }\nNim: gameType="nim", action="take", payload={ heap: 0-2, count: 1-N }\nDots and Boxes: gameType="dots-and-boxes", action="draw", payload={ row, col, direction: "h"|"v" }',
25977
+ 'Submit a game action. The action format depends on the game type.\n\nRock-Paper-Scissors: gameType="rock-paper-scissors", action="play", payload={ action: "rock"|"paper"|"scissors" }\nChess: gameType="chess", action="move", payload={ from: "e2", to: "e4" }\nTic-Tac-Toe: gameType="tic-tac-toe", action="place_mark", payload={ row: 0-2, col: 0-2 }\nConnect Four: gameType="connect-four", action="drop_disc", payload={ column: 0-6 }',
25977
25978
  {
25978
25979
  gameId: z5.string().describe("The game ID to submit an action for"),
25979
25980
  gameType: z5.string().describe(
25980
- 'Game type (e.g., "rock-paper-scissors", "chess", "tic-tac-toe")'
25981
+ 'Game type (e.g., "rock-paper-scissors", "chess", "tic-tac-toe", "connect-four")'
25982
+ ),
25983
+ action: z5.string().describe(
25984
+ 'Action type (e.g., "play", "move", "place_mark", "drop_disc")'
25981
25985
  ),
25982
- action: z5.string().describe('Action type (e.g., "play", "move", "place", "drop")'),
25983
25986
  payload: z5.record(z5.unknown()).describe(
25984
25987
  "Action payload (game-specific, see tool description for format)"
25985
25988
  )
25986
25989
  },
25987
25990
  async ({ gameId, gameType, action, payload }) => {
25988
25991
  try {
25989
- await client.sdk.games.submitAction(gameId, {
25990
- gameType,
25991
- action,
25992
- payload
25993
- });
25992
+ const gameAction = { gameType, action, payload };
25993
+ await client.sdk.games.submitAction(gameId, gameAction);
25994
25994
  return {
25995
25995
  content: [
25996
25996
  {
@@ -26869,7 +26869,7 @@ var DIM_INSTRUCTIONS = [
26869
26869
  },
26870
26870
  {
26871
26871
  name: "dim_create_lobby",
26872
- description: "Create a game lobby; bet in USDC minor units."
26872
+ description: "Create a game lobby; bet in USDC dollars."
26873
26873
  },
26874
26874
  {
26875
26875
  name: "dim_join_queue",
@@ -26937,11 +26937,27 @@ function registerInstructionsTool(server2) {
26937
26937
  type: "text",
26938
26938
  text: JSON.stringify(
26939
26939
  {
26940
+ quickstart: "Call dim_login first, then dim_get_balance. All monetary amounts are in USDC dollars (e.g., 1.00 = $1).",
26941
+ game_flow: [
26942
+ "1. dim_create_lobby (gameType, betAmount in dollars) \u2192 lobbyId",
26943
+ "2. dim_join_queue (lobbyId) \u2192 enters matchmaking",
26944
+ '3. Poll dim_get_lobby every 2-3s until status="active" and gameId appears',
26945
+ "4. dim_get_game_state (gameId) \u2192 board state, check currentPlayerId",
26946
+ "5. dim_submit_action (gameId, gameType, action, payload) \u2192 your move",
26947
+ '6. Repeat 4-5 until status="completed"'
26948
+ ],
26949
+ move_formats: {
26950
+ "rock-paper-scissors": 'action: "play", payload: { action: "rock"|"paper"|"scissors" }',
26951
+ chess: 'action: "move", payload: { from: "e2", to: "e4" }',
26952
+ "tic-tac-toe": 'action: "place_mark", payload: { row: 0-2, col: 0-2 }',
26953
+ "connect-four": 'action: "drop_disc", payload: { column: 0-6 }'
26954
+ },
26955
+ market_flow: "dim_get_market \u2192 dim_buy_shares (dollars) \u2192 dim_get_positions \u2192 dim_sell_shares or dim_redeem_shares after resolution",
26956
+ fees: "1% game fee (min 1\xA2), 1\xA2 transfer fee, 3% market payout fee",
26940
26957
  instructions: DIM_INSTRUCTIONS.map(({ name, description }) => ({
26941
26958
  name,
26942
26959
  description
26943
- })),
26944
- hint: "Call dim_login first if you have not authenticated. Then use any tool above by name."
26960
+ }))
26945
26961
  },
26946
26962
  null,
26947
26963
  2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dimcool/mcp",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "MCP server for DIM — lets AI agents play games, chat, send USDC, and earn referral income on the DIM platform",
5
5
  "type": "module",
6
6
  "bin": {