{"openapi":"3.1.0","info":{"title":"chess-eval","version":"0.1.0","description":"Evaluate a chess position with Stockfish: best move, centipawn/mate score, principal variation, and optional multipv. No mocks — a real single-threaded Stockfish 10 (asm.js) runs in-isolate per call.; Play out Stockfish's predicted principal variation as SAN moves with a per-ply eval, re-searching after each ply.","x-guidance":"Call `evaluate_position` with a FEN to get the engine's best move, centipawn/mate score, principal variation, and (optionally) the top `multipv` distinct lines. Call `best_line` to get the full predicted line as SAN moves with a per-ply eval instead of just the top move. FEN is validated strictly before the engine runs (illegal or malformed FEN is rejected before any Stockfish work). `depth` defaults to 12 (1-18) and is capped by a ~9.5s wall-clock budget per call — a deep request may return early with `depthReached` below the requested depth and `timedOut: true`. Terminal positions (checkmate/stalemate/draw) return that `status` with no move.","contact":{"email":"jeff@fosterinstruments.com"}},"servers":[{"url":"https://chess-eval.x402supply.com"}],"paths":{"/mcp":{"post":{"operationId":"chess-eval_call","summary":"Call chess-eval via MCP tools/call","tags":["chess-eval"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["jsonrpc","id","method","params"],"properties":{"jsonrpc":{"const":"2.0"},"id":{"type":["string","number"]},"method":{"const":"tools/call"},"params":{"type":"object","required":["name","arguments"],"properties":{"name":{"const":"evaluate_position"},"arguments":{"type":"object","properties":{"fen":{"type":"string"},"depth":{"type":"integer","minimum":1,"maximum":18},"multipv":{"type":"integer","minimum":1,"maximum":5}},"required":["fen"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}}},{"type":"object","required":["jsonrpc","id","method","params"],"properties":{"jsonrpc":{"const":"2.0"},"id":{"type":["string","number"]},"method":{"const":"tools/call"},"params":{"type":"object","required":["name","arguments"],"properties":{"name":{"const":"best_line"},"arguments":{"type":"object","properties":{"fen":{"type":"string"},"depth":{"type":"integer","minimum":1,"maximum":18},"maxPlies":{"type":"integer","minimum":1,"maximum":40}},"required":["fen"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}}}]}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"oneOf":[{"type":"object","description":"JSON-RPC 2.0 response envelope. `result.content[0].text` is a JSON-encoded string matching the schema in `x-mcp-result-schema`.","properties":{"jsonrpc":{"const":"2.0"},"id":{"type":["string","number"]},"result":{"type":"object","properties":{"content":{"type":"array","items":{"type":"object","properties":{"type":{"const":"text"},"text":{"type":"string"}}}}}}},"x-mcp-result-schema":{"type":"object","required":["status","bestMove","pv","depthReached","timedOut","multipv","engine","fenEchoed"],"properties":{"status":{"type":"string","enum":["ok","checkmate","stalemate","draw"]},"bestMove":{"type":["string","null"]},"bestMoveSan":{"type":["string","null"]},"pv":{"type":"array","items":{"type":"string"},"description":"Principal variation in SAN"},"pvUci":{"type":"array","items":{"type":"string"}},"depthReached":{"type":"integer"},"timedOut":{"type":"boolean"},"multipv":{"type":"array","items":{"type":"object","required":["move","moveSan","pv","pvUci"],"properties":{"move":{"type":"string"},"moveSan":{"type":"string"},"pv":{"type":"array","items":{"type":"string"}},"evalCp":{"type":"number","description":"Centipawn score from the side-to-move's perspective, omitted if mateIn is set"},"mateIn":{"type":"integer","description":"Moves to mate from the side-to-move's perspective (negative = getting mated), omitted if evalCp is set"}}}},"engine":{"type":"string"},"fenEchoed":{"type":"string"},"evalCp":{"type":"number","description":"Centipawn score from the side-to-move's perspective, omitted if mateIn is set"},"mateIn":{"type":"integer","description":"Moves to mate from the side-to-move's perspective (negative = getting mated), omitted if evalCp is set"}}}},{"type":"object","description":"JSON-RPC 2.0 response envelope. `result.content[0].text` is a JSON-encoded string matching the schema in `x-mcp-result-schema`.","properties":{"jsonrpc":{"const":"2.0"},"id":{"type":["string","number"]},"result":{"type":"object","properties":{"content":{"type":"array","items":{"type":"object","properties":{"type":{"const":"text"},"text":{"type":"string"}}}}}}},"x-mcp-result-schema":{"type":"object","required":["status","line","depthReached","timedOut","engine","fenEchoed"],"properties":{"status":{"type":"string","enum":["ok","checkmate","stalemate","draw"]},"line":{"type":"array","items":{"type":"object","required":["ply","move","san","depthReached"],"properties":{"ply":{"type":"integer"},"move":{"type":"string"},"san":{"type":"string"},"depthReached":{"type":"integer"},"evalCp":{"type":"number","description":"Centipawn score from the side-to-move's perspective, omitted if mateIn is set"},"mateIn":{"type":"integer","description":"Moves to mate from the side-to-move's perspective (negative = getting mated), omitted if evalCp is set"}}}},"depthReached":{"type":"integer"},"timedOut":{"type":"boolean"},"engine":{"type":"string"},"fenEchoed":{"type":"string"}}}}]}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"type":"object","properties":{"x402Version":{"type":"integer"},"error":{"type":"string"},"accepts":{"type":"array"}}}}}}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"protocols":[{"x402":{}}]}}},"/tools/evaluate_position":{"post":{"operationId":"chess-eval_evaluate_position_http","summary":"Evaluate a chess position with Stockfish: best move, centipawn/mate score, principal variation, and optional multipv. No mocks — a real single-threaded Stockfish 10 (asm.js) runs in-isolate per call.","tags":["chess-eval"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fen":{"type":"string"},"depth":{"type":"integer","minimum":1,"maximum":18},"multipv":{"type":"integer","minimum":1,"maximum":5}},"required":["fen"],"additionalProperties":false},"example":{"fen":"rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1","depth":10}}}},"responses":{"200":{"description":"Tool result (plain JSON, not MCP-wrapped)","content":{"application/json":{"schema":{"type":"object","required":["status","bestMove","pv","depthReached","timedOut","multipv","engine","fenEchoed"],"properties":{"status":{"type":"string","enum":["ok","checkmate","stalemate","draw"]},"bestMove":{"type":["string","null"]},"bestMoveSan":{"type":["string","null"]},"pv":{"type":"array","items":{"type":"string"},"description":"Principal variation in SAN"},"pvUci":{"type":"array","items":{"type":"string"}},"depthReached":{"type":"integer"},"timedOut":{"type":"boolean"},"multipv":{"type":"array","items":{"type":"object","required":["move","moveSan","pv","pvUci"],"properties":{"move":{"type":"string"},"moveSan":{"type":"string"},"pv":{"type":"array","items":{"type":"string"}},"evalCp":{"type":"number","description":"Centipawn score from the side-to-move's perspective, omitted if mateIn is set"},"mateIn":{"type":"integer","description":"Moves to mate from the side-to-move's perspective (negative = getting mated), omitted if evalCp is set"}}}},"engine":{"type":"string"},"fenEchoed":{"type":"string"},"evalCp":{"type":"number","description":"Centipawn score from the side-to-move's perspective, omitted if mateIn is set"},"mateIn":{"type":"integer","description":"Moves to mate from the side-to-move's perspective (negative = getting mated), omitted if evalCp is set"}}},"example":{"status":"ok","bestMove":"d7d5","bestMoveSan":"d5","pv":["d5","e5","d4","c3","Nc6","Nf3","dxc3"],"pvUci":["d7d5","e4e5","d5d4","c2c3","b8c6","g1f3","d4c3"],"depthReached":10,"timedOut":false,"multipv":[{"move":"d7d5","moveSan":"d5","pv":["d5","e5","d4","c3","Nc6","Nf3","dxc3"],"pvUci":["d7d5","e4e5","d5d4","c2c3","b8c6","g1f3","d4c3"],"evalCp":-29}],"engine":"stockfish 10 asm.js","fenEchoed":"rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1","perspective":"side-to-move","evalCp":-29}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"type":"object","properties":{"x402Version":{"type":"integer"},"error":{"type":"string"},"accepts":{"type":"array"}}}}}}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"protocols":[{"x402":{}}]}}},"/tools/best_line":{"post":{"operationId":"chess-eval_best_line_http","summary":"Play out Stockfish's predicted principal variation as SAN moves with a per-ply eval, re-searching after each ply.","tags":["chess-eval"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fen":{"type":"string"},"depth":{"type":"integer","minimum":1,"maximum":18},"maxPlies":{"type":"integer","minimum":1,"maximum":40}},"required":["fen"],"additionalProperties":false},"example":{"fen":"rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1","depth":10,"maxPlies":4}}}},"responses":{"200":{"description":"Tool result (plain JSON, not MCP-wrapped)","content":{"application/json":{"schema":{"type":"object","required":["status","line","depthReached","timedOut","engine","fenEchoed"],"properties":{"status":{"type":"string","enum":["ok","checkmate","stalemate","draw"]},"line":{"type":"array","items":{"type":"object","required":["ply","move","san","depthReached"],"properties":{"ply":{"type":"integer"},"move":{"type":"string"},"san":{"type":"string"},"depthReached":{"type":"integer"},"evalCp":{"type":"number","description":"Centipawn score from the side-to-move's perspective, omitted if mateIn is set"},"mateIn":{"type":"integer","description":"Moves to mate from the side-to-move's perspective (negative = getting mated), omitted if evalCp is set"}}}},"depthReached":{"type":"integer"},"timedOut":{"type":"boolean"},"engine":{"type":"string"},"fenEchoed":{"type":"string"}}},"example":{"status":"ok","line":[{"ply":1,"move":"d7d5","san":"d5","depthReached":10,"evalCp":-29},{"ply":2,"move":"e4d5","san":"exd5","depthReached":10,"evalCp":100},{"ply":3,"move":"c7c6","san":"c6","depthReached":10,"evalCp":-52},{"ply":4,"move":"g1f3","san":"Nf3","depthReached":10,"evalCp":96}],"depthReached":10,"timedOut":false,"engine":"stockfish 10 asm.js","fenEchoed":"rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1","perspective":"side-to-move"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"type":"object","properties":{"x402Version":{"type":"integer"},"error":{"type":"string"},"accepts":{"type":"array"}}}}}}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"protocols":[{"x402":{}}]}}}}}