@chessceo/mcp 0.49.2 → 0.49.3
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 +12 -0
- 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
|
+
51 tools as of v0.49.3, 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, renameCollection, searchPrepFiles, } from "./prep/library.js";
|
|
32
|
+
import { createCollection, createPrepFile, findPositionInFiles, listCollections, listPrepFiles, renameCollection, searchPrepFiles, setCollectionFolder, } 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
|
|
@@ -44,6 +44,7 @@ const AUTHED_TOOLS = new Set([
|
|
|
44
44
|
"list_collections",
|
|
45
45
|
"create_collection",
|
|
46
46
|
"rename_collection",
|
|
47
|
+
"set_collection_folder",
|
|
47
48
|
"list_prep_files",
|
|
48
49
|
"search_prep_files",
|
|
49
50
|
"find_position_in_files",
|
|
@@ -443,6 +444,8 @@ async function callToolInner(name, args) {
|
|
|
443
444
|
return createCollection(args);
|
|
444
445
|
case "rename_collection":
|
|
445
446
|
return renameCollection(args);
|
|
447
|
+
case "set_collection_folder":
|
|
448
|
+
return setCollectionFolder(args);
|
|
446
449
|
case "list_prep_files":
|
|
447
450
|
return listPrepFiles(args);
|
|
448
451
|
case "search_prep_files":
|
package/dist/prep/library.js
CHANGED
|
@@ -102,6 +102,18 @@ export async function renameCollection(args) {
|
|
|
102
102
|
const collection = unwrap(raw);
|
|
103
103
|
return { ok: true, id: collection.id, title: collection.title };
|
|
104
104
|
}
|
|
105
|
+
export async function setCollectionFolder(args) {
|
|
106
|
+
const id = typeof args.id === "string" ? args.id.trim() : "";
|
|
107
|
+
if (!id)
|
|
108
|
+
throw new Error("id is required");
|
|
109
|
+
if (typeof args.folder_path !== "string") {
|
|
110
|
+
throw new Error("folder_path is required (pass an empty string to move the collection to root)");
|
|
111
|
+
}
|
|
112
|
+
const folderPath = args.folder_path.trim();
|
|
113
|
+
const raw = await authedRequest("PUT", `${PGN_BASE}/${encodeURIComponent(id)}`, { folderPath });
|
|
114
|
+
const collection = unwrap(raw);
|
|
115
|
+
return { ok: true, id: collection.id, folder_path: collection.folderPath };
|
|
116
|
+
}
|
|
105
117
|
export async function createPrepFile(args) {
|
|
106
118
|
const collectionId = typeof args.collection_id === "string" ? args.collection_id.trim() : "";
|
|
107
119
|
if (!collectionId) {
|
package/dist/tools.js
CHANGED
|
@@ -499,6 +499,18 @@ export const TOOLS = [
|
|
|
499
499
|
required: ["id", "title"],
|
|
500
500
|
},
|
|
501
501
|
},
|
|
502
|
+
{
|
|
503
|
+
name: "set_collection_folder",
|
|
504
|
+
description: "Move a collection to a different virtual folder — changes only folder_path, not title or contents. Pass an empty string to move it to root (no folder). folder_path is just a string field on each collection, not a real directory: this moves one collection at a time, it does not rename/merge a folder across every collection under it.",
|
|
505
|
+
inputSchema: {
|
|
506
|
+
type: "object",
|
|
507
|
+
properties: {
|
|
508
|
+
id: { type: "string", description: "Collection id, from list_collections." },
|
|
509
|
+
folder_path: { type: "string", description: "New virtual folder path, e.g. '/Openings/Sicilian'. Empty string moves the collection to root." },
|
|
510
|
+
},
|
|
511
|
+
required: ["id", "folder_path"],
|
|
512
|
+
},
|
|
513
|
+
},
|
|
502
514
|
{
|
|
503
515
|
name: "create_prep_file",
|
|
504
516
|
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