diff --git a/src/constants.ts b/src/constants.ts
new file mode 100644
index 0000000..f38850e
--- /dev/null
+++ b/src/constants.ts
@@ -0,0 +1,2 @@
+export const FIELD_FORMATS_DESCRIPTION =
+ 'Field formats: text|textArea ="string"; textArea uses "\\n" for multi-line input; richEditorV2="
HTML
"; richEditor uses "\\n" plain text; image="https://images.microcms-assets.io/..."; mediaList=["https://...","https://..."]; date="2020-04-23T14:32:38.163Z"; number=123; boolean=true; select=["option1","option2"]; relation="contentId"; relationList=["id1","id2"]; custom={ "fieldId": "...", ...values }; repeater=[{ "fieldId": "...", ...values }]; file="https://files.microcms-assets.io/..."; iframe={ "id": "...", "title": "...", "description": "...", "imageUrl": "https://...", "updatedAt": "2024-01-01T00:00:00Z", "data": { ... } }; publishedAt="2024-01-01T00:00:00Z". Asset URLs must belong to the same microCMS service (custom domains are accepted).';
diff --git a/src/tools/create-content-draft.ts b/src/tools/create-content-draft.ts
index 45ccfb1..5973926 100644
--- a/src/tools/create-content-draft.ts
+++ b/src/tools/create-content-draft.ts
@@ -1,5 +1,6 @@
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import { create } from '../client.js';
+import { FIELD_FORMATS_DESCRIPTION } from '../constants.js';
import type { ToolParameters, MicroCMSCreateOptions } from '../types.js';
export const createContentDraftTool: Tool = {
@@ -14,7 +15,8 @@ export const createContentDraftTool: Tool = {
},
content: {
type: 'object',
- description: 'Content data to create (JSON object). Field formats: text="string", richEditor="HTML
", image="https://images.microcms-assets.io/...", multipleImages=["url1","url2"], date="2020-04-23T14:32:38.163Z", select=["option1","option2"], contentReference="contentId" or ["id1","id2"].',
+ description:
+ 'Content data to create (JSON object). ' + FIELD_FORMATS_DESCRIPTION,
},
contentId: {
type: 'string',
@@ -39,4 +41,4 @@ export async function handleCreateContentDraft(params: ToolParameters) {
if (options.contentId) createOptions.contentId = options.contentId;
return await create(endpoint, content, createOptions);
-}
\ No newline at end of file
+}
diff --git a/src/tools/create-content-published.ts b/src/tools/create-content-published.ts
index dbef239..286e2f2 100644
--- a/src/tools/create-content-published.ts
+++ b/src/tools/create-content-published.ts
@@ -1,5 +1,6 @@
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import { create } from '../client.js';
+import { FIELD_FORMATS_DESCRIPTION } from '../constants.js';
import type { ToolParameters, MicroCMSCreateOptions } from '../types.js';
export const createContentPublishedTool: Tool = {
@@ -14,7 +15,8 @@ export const createContentPublishedTool: Tool = {
},
content: {
type: 'object',
- description: 'Content data to create (JSON object). Field formats: text="string", richEditor="HTML
", image="https://images.microcms-assets.io/...", multipleImages=["url1","url2"], date="2020-04-23T14:32:38.163Z", select=["option1","option2"], contentReference="contentId" or ["id1","id2"].',
+ description:
+ 'Content data to create (JSON object). ' + FIELD_FORMATS_DESCRIPTION,
},
contentId: {
type: 'string',
@@ -39,4 +41,4 @@ export async function handleCreateContentPublished(params: ToolParameters) {
if (options.contentId) createOptions.contentId = options.contentId;
return await create(endpoint, content, createOptions);
-}
\ No newline at end of file
+}
diff --git a/src/tools/patch-content.ts b/src/tools/patch-content.ts
index 062170c..1c145e2 100644
--- a/src/tools/patch-content.ts
+++ b/src/tools/patch-content.ts
@@ -1,5 +1,6 @@
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import { patch } from '../client.js';
+import { FIELD_FORMATS_DESCRIPTION } from '../constants.js';
import type { ToolParameters, MicroCMSUpdateOptions } from '../types.js';
export const patchContentTool: Tool = {
@@ -18,7 +19,9 @@ export const patchContentTool: Tool = {
},
content: {
type: 'object',
- description: 'Partial content data to update (JSON object). Field formats: text="string", richEditor="HTML
", image="https://images.microcms-assets.io/...", multipleImages=["url1","url2"], date="2020-04-23T14:32:38.163Z", select=["option1","option2"], contentReference="contentId" or ["id1","id2"].',
+ description:
+ 'Partial content data to update (JSON object). ' +
+ FIELD_FORMATS_DESCRIPTION,
},
isDraft: {
type: 'boolean',
@@ -45,4 +48,4 @@ export async function handlePatchContent(params: ToolParameters) {
if (options.isDraft !== undefined) updateOptions.isDraft = options.isDraft;
return await patch(endpoint, contentId, content, updateOptions);
-}
\ No newline at end of file
+}
diff --git a/src/tools/update-content-draft.ts b/src/tools/update-content-draft.ts
index 5fe7914..1ae3d93 100644
--- a/src/tools/update-content-draft.ts
+++ b/src/tools/update-content-draft.ts
@@ -1,5 +1,6 @@
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import { update } from '../client.js';
+import { FIELD_FORMATS_DESCRIPTION } from '../constants.js';
import type { ToolParameters, MicroCMSUpdateOptions } from '../types.js';
export const updateContentDraftTool: Tool = {
@@ -18,7 +19,8 @@ export const updateContentDraftTool: Tool = {
},
content: {
type: 'object',
- description: 'Content data to update (JSON object). Field formats: text="string", richEditor="HTML
", image="https://images.microcms-assets.io/...", multipleImages=["url1","url2"], date="2020-04-23T14:32:38.163Z", select=["option1","option2"], contentReference="contentId" or ["id1","id2"].',
+ description:
+ 'Content data to update (JSON object). ' + FIELD_FORMATS_DESCRIPTION,
},
},
required: ['endpoint', 'contentId', 'content'],
@@ -41,4 +43,4 @@ export async function handleUpdateContentDraft(params: ToolParameters) {
};
return await update(endpoint, contentId, content, updateOptions);
-}
\ No newline at end of file
+}
diff --git a/src/tools/update-content-published.ts b/src/tools/update-content-published.ts
index 2f26956..07f8433 100644
--- a/src/tools/update-content-published.ts
+++ b/src/tools/update-content-published.ts
@@ -1,5 +1,6 @@
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import { update } from '../client.js';
+import { FIELD_FORMATS_DESCRIPTION } from '../constants.js';
import type { ToolParameters, MicroCMSUpdateOptions } from '../types.js';
export const updateContentPublishedTool: Tool = {
@@ -18,7 +19,8 @@ export const updateContentPublishedTool: Tool = {
},
content: {
type: 'object',
- description: 'Content data to update (JSON object). Field formats: text="string", richEditor="HTML
", image="https://images.microcms-assets.io/...", multipleImages=["url1","url2"], date="2020-04-23T14:32:38.163Z", select=["option1","option2"], contentReference="contentId" or ["id1","id2"].',
+ description:
+ 'Content data to update (JSON object). ' + FIELD_FORMATS_DESCRIPTION,
},
},
required: ['endpoint', 'contentId', 'content'],
@@ -41,4 +43,4 @@ export async function handleUpdateContentPublished(params: ToolParameters) {
};
return await update(endpoint, contentId, content, updateOptions);
-}
\ No newline at end of file
+}