@chessceo/mcp 0.49.0 → 0.49.2
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.
- package/README.md +1 -1
- package/dist/index.js +4 -1
- package/dist/prep/library.js +18 -4
- package/dist/tools.js +12 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Player/game lookups need no API key or auth. Cloud engines and prep-file tools n
|
|
|
6
6
|
|
|
7
7
|
## What it can do
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
50 tools as of v0.49.2, mirroring the `chess.ceo` API surface. A few of the most-used:
|
|
10
10
|
|
|
11
11
|
| Tool | What it answers |
|
|
12
12
|
|---|---|
|
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ import { getNodeByPath, resolveFromNodeOrFen, storeEvalOnNode, } from "./analysi
|
|
|
29
29
|
import { findPositionInCourses, readCourseAtPosition, runSfEval } from "./courses.js";
|
|
30
30
|
import { applyBatchMutations, applyMutation, argNodeId, } from "./prep/mutations.js";
|
|
31
31
|
import { listNodes, listTranspositions, readPrepFile, } from "./prep/read.js";
|
|
32
|
-
import { createCollection, createPrepFile, findPositionInFiles, listCollections, listPrepFiles, searchPrepFiles, } from "./prep/library.js";
|
|
32
|
+
import { createCollection, createPrepFile, findPositionInFiles, listCollections, listPrepFiles, renameCollection, searchPrepFiles, } from "./prep/library.js";
|
|
33
33
|
import { convertAvailableMovesToSAN, normalizeSourceForBackend, stripPositionResponse, trimGamesMovetext, } from "./response_transforms.js";
|
|
34
34
|
// Tools that require an MCP token — cloud engine + prep-file tools
|
|
35
35
|
// operate on the caller's own account so we can't service them
|
|
@@ -43,6 +43,7 @@ const AUTHED_TOOLS = new Set([
|
|
|
43
43
|
"cloud_analyse",
|
|
44
44
|
"list_collections",
|
|
45
45
|
"create_collection",
|
|
46
|
+
"rename_collection",
|
|
46
47
|
"list_prep_files",
|
|
47
48
|
"search_prep_files",
|
|
48
49
|
"find_position_in_files",
|
|
@@ -440,6 +441,8 @@ async function callToolInner(name, args) {
|
|
|
440
441
|
return listCollections(args);
|
|
441
442
|
case "create_collection":
|
|
442
443
|
return createCollection(args);
|
|
444
|
+
case "rename_collection":
|
|
445
|
+
return renameCollection(args);
|
|
443
446
|
case "list_prep_files":
|
|
444
447
|
return listPrepFiles(args);
|
|
445
448
|
case "search_prep_files":
|
package/dist/prep/library.js
CHANGED
|
@@ -53,8 +53,11 @@ export async function searchPrepFiles(args) {
|
|
|
53
53
|
if (!q)
|
|
54
54
|
throw new Error("query required");
|
|
55
55
|
const raw = await authedRequest("GET", `${PGN_BASE}/games/search?q=${encodeURIComponent(q)}&limit=100`);
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
// Unlike list_prep_files' {games:[...]} envelope, the cross-collection
|
|
57
|
+
// search handler (RespondPaginated) puts the array straight into `data` —
|
|
58
|
+
// `data?.games` was always undefined here, so this silently returned []
|
|
59
|
+
// for every query/position regardless of real matches (found 2026-09-11).
|
|
60
|
+
const games = unwrap(raw) ?? [];
|
|
58
61
|
return { query: q, prep_files: games.map(projectGameRow) };
|
|
59
62
|
}
|
|
60
63
|
export async function findPositionInFiles(args) {
|
|
@@ -63,8 +66,8 @@ export async function findPositionInFiles(args) {
|
|
|
63
66
|
const resolved = await resolveFromNodeOrFen(args);
|
|
64
67
|
const fen = resolved.fen;
|
|
65
68
|
const raw = await authedRequest("GET", `${PGN_BASE}/games/search?position=${encodeURIComponent(fen)}&limit=100`);
|
|
66
|
-
|
|
67
|
-
const games =
|
|
69
|
+
// See searchPrepFiles above — RespondPaginated's `data` is the array itself.
|
|
70
|
+
const games = unwrap(raw) ?? [];
|
|
68
71
|
return {
|
|
69
72
|
fen,
|
|
70
73
|
match_count: games.length,
|
|
@@ -88,6 +91,17 @@ export async function createCollection(args) {
|
|
|
88
91
|
folder_path: collection.folderPath,
|
|
89
92
|
};
|
|
90
93
|
}
|
|
94
|
+
export async function renameCollection(args) {
|
|
95
|
+
const id = typeof args.id === "string" ? args.id.trim() : "";
|
|
96
|
+
if (!id)
|
|
97
|
+
throw new Error("id is required");
|
|
98
|
+
const title = String(args.title || "").trim();
|
|
99
|
+
if (!title)
|
|
100
|
+
throw new Error("title is required");
|
|
101
|
+
const raw = await authedRequest("PUT", `${PGN_BASE}/${encodeURIComponent(id)}`, { title });
|
|
102
|
+
const collection = unwrap(raw);
|
|
103
|
+
return { ok: true, id: collection.id, title: collection.title };
|
|
104
|
+
}
|
|
91
105
|
export async function createPrepFile(args) {
|
|
92
106
|
const collectionId = typeof args.collection_id === "string" ? args.collection_id.trim() : "";
|
|
93
107
|
if (!collectionId) {
|
package/dist/tools.js
CHANGED
|
@@ -487,6 +487,18 @@ export const TOOLS = [
|
|
|
487
487
|
required: ["title"],
|
|
488
488
|
},
|
|
489
489
|
},
|
|
490
|
+
{
|
|
491
|
+
name: "rename_collection",
|
|
492
|
+
description: "Rename a collection — changes only its title, not its contents or folder_path. Use when reorganizing: consolidating similarly-named collections, fixing a typo, or renaming a working title to something clearer once its scope is settled.",
|
|
493
|
+
inputSchema: {
|
|
494
|
+
type: "object",
|
|
495
|
+
properties: {
|
|
496
|
+
id: { type: "string", description: "Collection id, from list_collections." },
|
|
497
|
+
title: { type: "string", description: "New collection name." },
|
|
498
|
+
},
|
|
499
|
+
required: ["id", "title"],
|
|
500
|
+
},
|
|
501
|
+
},
|
|
490
502
|
{
|
|
491
503
|
name: "create_prep_file",
|
|
492
504
|
description: "Create a new (empty) prep file in the specified collection. `name` becomes the Event PGN tag. You then extend it with mutation tools (add_move, set_comment, …).\n\n" +
|
package/package.json
CHANGED