diff --git a/package.json b/package.json index 480dd97..a186f8e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@missionsquad/mcp-wordpress", - "version": "0.2.2", + "version": "0.2.3", "description": "A Model Context Protocol server for interacting with WordPress.", "type": "module", "main": "./build/server.js", diff --git a/src/tools/acf.ts b/src/tools/acf.ts index 0e82096..9f84070 100644 --- a/src/tools/acf.ts +++ b/src/tools/acf.ts @@ -19,13 +19,11 @@ export const getAcfSchemaSchema = z .enum(['content', 'term', 'user']) .describe('Schema target. Use content for posts/pages/CPTs, term for taxonomy terms, and user for users.'), content_type: z - .preprocess((value) => (typeof value === 'string' && value.trim() === '' ? undefined : value), z.string().optional()) - .optional() - .describe('Required only when target is content. WordPress post type slug, such as post, page, book, or product.'), + .preprocess((value) => (typeof value === 'string' && value.trim() === '' ? undefined : value), z.string().default('post')) + .describe('Used only when target is content. WordPress post type slug, such as post, page, book, or product. Defaults to post.'), taxonomy: z - .preprocess((value) => (typeof value === 'string' && value.trim() === '' ? undefined : value), z.string().optional()) - .optional() - .describe('Required only when target is term. WordPress taxonomy slug, such as category, post_tag, or genre.'), + .preprocess((value) => (typeof value === 'string' && value.trim() === '' ? undefined : value), z.string().default('category')) + .describe('Used only when target is term. WordPress taxonomy slug, such as category, post_tag, or genre. Defaults to category.'), id: z .preprocess((value) => { if (typeof value === 'string') { @@ -142,10 +140,6 @@ async function requestOptionsForResolvedRoute(route: RestRoute, id?: number): Pr function validateGetAcfSchemaParams(params: z.infer): GetAcfSchemaParams { if (params.target === 'content') { - if (!params.content_type) { - throw new Error('content_type is required when target is "content".') - } - if (params.id === 'me') { throw new Error('id must be numeric when target is "content".') } @@ -158,10 +152,6 @@ function validateGetAcfSchemaParams(params: z.infer): } if (params.target === 'term') { - if (!params.taxonomy) { - throw new Error('taxonomy is required when target is "term".') - } - if (params.id === 'me') { throw new Error('id must be numeric when target is "term".') }