@easy-cms/plugin-mcp 1.27.0 → 1.29.0

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 +13 -3
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ var INFO = {
12
12
  name: "@easy-cms/plugin-mcp",
13
13
  // The plugin API it is written for (`PLUGIN_API_VERSION` of @easy-cms/core).
14
14
  apiVersion: 1,
15
- ...true ? { version: "1.27.0" } : {}
15
+ ...true ? { version: "1.29.0" } : {}
16
16
  };
17
17
 
18
18
  // src/tools.ts
@@ -76,8 +76,18 @@ function fieldSchema(field) {
76
76
  } : { ...id2, description: hint(`id of a media document${types} (see upload_media)`) };
77
77
  }
78
78
  case "relationship": {
79
- const id2 = { type: ["integer", "string"] };
80
- const about = hint(`id of a document in "${field.to}"`);
79
+ const id2 = typeof field.to === "string" ? { type: ["integer", "string"] } : {
80
+ type: "object",
81
+ properties: {
82
+ relationTo: { type: "string", enum: [...field.to] },
83
+ value: { type: ["integer", "string"] }
84
+ },
85
+ required: ["relationTo", "value"],
86
+ additionalProperties: false
87
+ };
88
+ const about = hint(
89
+ typeof field.to === "string" ? `id of a document in "${field.to}"` : `a document in one of ${field.to.map((t) => `"${t}"`).join(", ")}: its collection and id`
90
+ );
81
91
  return field.hasMany ? {
82
92
  type: "array",
83
93
  items: id2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-cms/plugin-mcp",
3
- "version": "1.27.0",
3
+ "version": "1.29.0",
4
4
  "description": "MCP server for Easy CMS: let AI assistants read and write content with API keys (experimental)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -19,11 +19,11 @@
19
19
  "@modelcontextprotocol/sdk": "^1.32.1"
20
20
  },
21
21
  "peerDependencies": {
22
- "@easy-cms/core": "^1.27.0"
22
+ "@easy-cms/core": "^1.29.0"
23
23
  },
24
24
  "devDependencies": {
25
- "@easy-cms/core": "^1.27.0",
26
- "@easy-cms/db-sqlite": "^1.27.0"
25
+ "@easy-cms/core": "^1.29.0",
26
+ "@easy-cms/db-sqlite": "^1.29.0"
27
27
  },
28
28
  "engines": {
29
29
  "node": ">=22.12"