Skip to main content
Glama
fritzprix

Rubik's Cube MCP Server

by fritzprix

finish

Complete a Rubik's Cube solving session by providing the game session ID to finalize the puzzle solution process.

Instructions

Complete the Rubik's Cube game session

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gameIdYesThe game session ID

Implementation Reference

  • Handler function for the 'finish' MCP tool that completes the Rubik's Cube game session by marking it as completed, checking if solved, generating a congratulatory or failure message, and returning the final cube state with MCP-formatted content.
    async ({ gameId }: { gameId: string }) => { const game = this.games.get(gameId); if (!game) { throw new Error(`Game session ${gameId} not found`); } const { cube, session } = game; const finalState = cube.getState(); session.status = 'completed'; session.lastActivity = Date.now(); const response: CubeResponse = { gameId, cube: finalState, nextAction: null, }; const message = finalState.solved ? `πŸŽ‰ Congratulations! You solved the cube for game ${gameId}.` : `Game ${gameId} finished. The cube was not solved.` return { content: [ { type: "text", text: message }, { type: "text", text: JSON.stringify(response, null, 2) }, ], }; }
  • Input schema for the 'finish' tool defined using Zod, requiring a 'gameId' string parameter.
    { gameId: z.string().describe("The game session ID") },
  • src/app.ts:180-182 (registration)
    Registration of the 'finish' MCP tool on the server, providing the tool name and description.
    this.mcpServer.tool( "finish", "Complete the Rubik's Cube game session",
Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fritzprix/rubiks-cube-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server