mcp-wordpress 1.1.2 → 1.1.6

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 (91) hide show
  1. package/README.md +8 -8
  2. package/bin/mcp-wordpress.js +1 -1
  3. package/dist/client/api.d.ts +10 -10
  4. package/dist/client/api.js +157 -157
  5. package/dist/client/api.js.map +1 -1
  6. package/dist/client/auth.d.ts +2 -2
  7. package/dist/client/auth.d.ts.map +1 -1
  8. package/dist/client/auth.js +72 -72
  9. package/dist/client/auth.js.map +1 -1
  10. package/dist/client/managers/AuthenticationManager.d.ts +2 -2
  11. package/dist/client/managers/AuthenticationManager.d.ts.map +1 -1
  12. package/dist/client/managers/AuthenticationManager.js +50 -46
  13. package/dist/client/managers/AuthenticationManager.js.map +1 -1
  14. package/dist/client/managers/BaseManager.d.ts +1 -1
  15. package/dist/client/managers/BaseManager.d.ts.map +1 -1
  16. package/dist/client/managers/BaseManager.js +9 -9
  17. package/dist/client/managers/BaseManager.js.map +1 -1
  18. package/dist/client/managers/RequestManager.d.ts +2 -2
  19. package/dist/client/managers/RequestManager.js +15 -15
  20. package/dist/client/managers/index.d.ts +3 -3
  21. package/dist/client/managers/index.js +3 -3
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +78 -61
  24. package/dist/index.js.map +1 -1
  25. package/dist/tools/auth.d.ts +2 -2
  26. package/dist/tools/auth.js +31 -31
  27. package/dist/tools/auth.js.map +1 -1
  28. package/dist/tools/comments.d.ts +2 -2
  29. package/dist/tools/comments.js +79 -79
  30. package/dist/tools/media.d.ts +2 -2
  31. package/dist/tools/media.d.ts.map +1 -1
  32. package/dist/tools/media.js +80 -80
  33. package/dist/tools/media.js.map +1 -1
  34. package/dist/tools/pages.d.ts +2 -2
  35. package/dist/tools/pages.js +75 -75
  36. package/dist/tools/posts.d.ts +2 -2
  37. package/dist/tools/posts.js +94 -94
  38. package/dist/tools/site.d.ts +2 -2
  39. package/dist/tools/site.js +60 -60
  40. package/dist/tools/site.js.map +1 -1
  41. package/dist/tools/taxonomies.d.ts +2 -2
  42. package/dist/tools/taxonomies.js +89 -89
  43. package/dist/tools/users.d.ts +2 -2
  44. package/dist/tools/users.js +68 -68
  45. package/dist/tools/users.js.map +1 -1
  46. package/dist/types/mcp.d.ts +1 -1
  47. package/dist/types/mcp.d.ts.map +1 -1
  48. package/dist/utils/debug.d.ts.map +1 -1
  49. package/dist/utils/debug.js +10 -6
  50. package/dist/utils/debug.js.map +1 -1
  51. package/dist/utils/toolWrapper.js +3 -3
  52. package/docs/developer/GITHUB_ACTIONS_SETUP.md +208 -0
  53. package/docs/developer/MAINTENANCE.md +307 -0
  54. package/docs/developer/MIGRATION_GUIDE.md +172 -0
  55. package/docs/developer/NPM_AUTH_SETUP.md +142 -0
  56. package/docs/developer/REFACTORING.md +196 -0
  57. package/docs/releases/COMMUNITY_ANNOUNCEMENT_v1.1.2.md +126 -0
  58. package/docs/releases/RELEASE_NOTES_v1.1.2.md +173 -0
  59. package/docs/user-guides/CLAUDE_DESKTOP_SETUP.md +187 -0
  60. package/package.json +4 -3
  61. package/src/client/api.ts +229 -229
  62. package/src/client/auth.ts +135 -136
  63. package/src/client/managers/AuthenticationManager.ts +148 -105
  64. package/src/client/managers/BaseManager.ts +15 -12
  65. package/src/client/managers/RequestManager.ts +17 -17
  66. package/src/client/managers/index.ts +3 -3
  67. package/src/index.ts +141 -114
  68. package/src/server.ts +1 -1
  69. package/src/tools/auth.ts +36 -36
  70. package/src/tools/comments.ts +90 -90
  71. package/src/tools/media.ts +89 -91
  72. package/src/tools/pages.ts +86 -86
  73. package/src/tools/posts.ts +106 -106
  74. package/src/tools/site.ts +71 -71
  75. package/src/tools/taxonomies.ts +102 -102
  76. package/src/tools/users.ts +77 -77
  77. package/src/types/client.ts +1 -1
  78. package/src/types/index.ts +1 -1
  79. package/src/types/mcp.ts +36 -16
  80. package/src/types/wordpress.ts +1 -1
  81. package/src/utils/debug.ts +63 -39
  82. package/src/utils/error.ts +1 -1
  83. package/src/utils/toolWrapper.ts +4 -4
  84. package/dist/client/WordPressClient.d.ts +0 -81
  85. package/dist/client/WordPressClient.d.ts.map +0 -1
  86. package/dist/client/WordPressClient.js +0 -354
  87. package/dist/client/WordPressClient.js.map +0 -1
  88. package/dist/tools/base.d.ts +0 -37
  89. package/dist/tools/base.d.ts.map +0 -1
  90. package/dist/tools/base.js +0 -60
  91. package/dist/tools/base.js.map +0 -1
@@ -1,10 +1,10 @@
1
- import { WordPressClient } from "../client/api.js";
1
+ import { WordPressClient } from '../client/api.js';
2
2
  import {
3
3
  CommentQueryParams,
4
4
  CreateCommentRequest,
5
- UpdateCommentRequest,
6
- } from "../types/wordpress.js";
7
- import { getErrorMessage } from "../utils/error.js";
5
+ UpdateCommentRequest
6
+ } from '../types/wordpress.js';
7
+ import { getErrorMessage } from '../utils/error.js';
8
8
 
9
9
  /**
10
10
  * Provides tools for managing comments on a WordPress site.
@@ -18,155 +18,155 @@ export class CommentTools {
18
18
  public getTools(): any[] {
19
19
  return [
20
20
  {
21
- name: "wp_list_comments",
22
- description: "Lists comments from a WordPress site, with filters.",
21
+ name: 'wp_list_comments',
22
+ description: 'Lists comments from a WordPress site, with filters.',
23
23
  parameters: [
24
24
  {
25
- name: "post",
26
- type: "number",
25
+ name: 'post',
26
+ type: 'number',
27
27
  description:
28
- "Limit results to comments assigned to a specific post ID.",
28
+ 'Limit results to comments assigned to a specific post ID.'
29
29
  },
30
30
  {
31
- name: "status",
32
- type: "string",
33
- description: "Filter by comment status.",
34
- enum: ["hold", "approve", "spam", "trash"],
35
- },
31
+ name: 'status',
32
+ type: 'string',
33
+ description: 'Filter by comment status.',
34
+ enum: ['hold', 'approve', 'spam', 'trash']
35
+ }
36
36
  ],
37
- handler: this.handleListComments.bind(this),
37
+ handler: this.handleListComments.bind(this)
38
38
  },
39
39
  {
40
- name: "wp_get_comment",
41
- description: "Retrieves a single comment by its ID.",
40
+ name: 'wp_get_comment',
41
+ description: 'Retrieves a single comment by its ID.',
42
42
  parameters: [
43
43
  {
44
- name: "id",
45
- type: "number",
44
+ name: 'id',
45
+ type: 'number',
46
46
  required: true,
47
- description: "The unique identifier for the comment.",
48
- },
47
+ description: 'The unique identifier for the comment.'
48
+ }
49
49
  ],
50
- handler: this.handleGetComment.bind(this),
50
+ handler: this.handleGetComment.bind(this)
51
51
  },
52
52
  {
53
- name: "wp_create_comment",
54
- description: "Creates a new comment on a post.",
53
+ name: 'wp_create_comment',
54
+ description: 'Creates a new comment on a post.',
55
55
  parameters: [
56
56
  {
57
- name: "post",
58
- type: "number",
57
+ name: 'post',
58
+ type: 'number',
59
59
  required: true,
60
- description: "The ID of the post to comment on.",
60
+ description: 'The ID of the post to comment on.'
61
61
  },
62
62
  {
63
- name: "content",
64
- type: "string",
63
+ name: 'content',
64
+ type: 'string',
65
65
  required: true,
66
- description: "The content of the comment.",
66
+ description: 'The content of the comment.'
67
67
  },
68
68
  {
69
- name: "author_name",
70
- type: "string",
71
- description: "The name of the comment author.",
69
+ name: 'author_name',
70
+ type: 'string',
71
+ description: 'The name of the comment author.'
72
72
  },
73
73
  {
74
- name: "author_email",
75
- type: "string",
76
- description: "The email of the comment author.",
77
- },
74
+ name: 'author_email',
75
+ type: 'string',
76
+ description: 'The email of the comment author.'
77
+ }
78
78
  ],
79
- handler: this.handleCreateComment.bind(this),
79
+ handler: this.handleCreateComment.bind(this)
80
80
  },
81
81
  {
82
- name: "wp_update_comment",
83
- description: "Updates an existing comment.",
82
+ name: 'wp_update_comment',
83
+ description: 'Updates an existing comment.',
84
84
  parameters: [
85
85
  {
86
- name: "id",
87
- type: "number",
86
+ name: 'id',
87
+ type: 'number',
88
88
  required: true,
89
- description: "The ID of the comment to update.",
89
+ description: 'The ID of the comment to update.'
90
90
  },
91
91
  {
92
- name: "content",
93
- type: "string",
94
- description: "The updated content for the comment.",
92
+ name: 'content',
93
+ type: 'string',
94
+ description: 'The updated content for the comment.'
95
95
  },
96
96
  {
97
- name: "status",
98
- type: "string",
99
- description: "The new status for the comment.",
100
- enum: ["hold", "approve", "spam", "trash"],
101
- },
97
+ name: 'status',
98
+ type: 'string',
99
+ description: 'The new status for the comment.',
100
+ enum: ['hold', 'approve', 'spam', 'trash']
101
+ }
102
102
  ],
103
- handler: this.handleUpdateComment.bind(this),
103
+ handler: this.handleUpdateComment.bind(this)
104
104
  },
105
105
  {
106
- name: "wp_delete_comment",
107
- description: "Deletes a comment.",
106
+ name: 'wp_delete_comment',
107
+ description: 'Deletes a comment.',
108
108
  parameters: [
109
109
  {
110
- name: "id",
111
- type: "number",
110
+ name: 'id',
111
+ type: 'number',
112
112
  required: true,
113
- description: "The ID of the comment to delete.",
113
+ description: 'The ID of the comment to delete.'
114
114
  },
115
115
  {
116
- name: "force",
117
- type: "boolean",
116
+ name: 'force',
117
+ type: 'boolean',
118
118
  description:
119
- "If true, the comment will be permanently deleted. Defaults to false (moved to trash).",
120
- },
119
+ 'If true, the comment will be permanently deleted. Defaults to false (moved to trash).'
120
+ }
121
121
  ],
122
- handler: this.handleDeleteComment.bind(this),
122
+ handler: this.handleDeleteComment.bind(this)
123
123
  },
124
124
  {
125
- name: "wp_approve_comment",
126
- description: "Approves a pending comment.",
125
+ name: 'wp_approve_comment',
126
+ description: 'Approves a pending comment.',
127
127
  parameters: [
128
128
  {
129
- name: "id",
130
- type: "number",
129
+ name: 'id',
130
+ type: 'number',
131
131
  required: true,
132
- description: "The ID of the comment to approve.",
133
- },
132
+ description: 'The ID of the comment to approve.'
133
+ }
134
134
  ],
135
- handler: this.handleApproveComment.bind(this),
135
+ handler: this.handleApproveComment.bind(this)
136
136
  },
137
137
  {
138
- name: "wp_spam_comment",
139
- description: "Marks a comment as spam.",
138
+ name: 'wp_spam_comment',
139
+ description: 'Marks a comment as spam.',
140
140
  parameters: [
141
141
  {
142
- name: "id",
143
- type: "number",
142
+ name: 'id',
143
+ type: 'number',
144
144
  required: true,
145
- description: "The ID of the comment to mark as spam.",
146
- },
145
+ description: 'The ID of the comment to mark as spam.'
146
+ }
147
147
  ],
148
- handler: this.handleSpamComment.bind(this),
149
- },
148
+ handler: this.handleSpamComment.bind(this)
149
+ }
150
150
  ];
151
151
  }
152
152
 
153
153
  public async handleListComments(
154
154
  client: WordPressClient,
155
- params: CommentQueryParams,
155
+ params: CommentQueryParams
156
156
  ): Promise<any> {
157
157
  try {
158
158
  const comments = await client.getComments(params);
159
159
  if (comments.length === 0) {
160
- return "No comments found matching the criteria.";
160
+ return 'No comments found matching the criteria.';
161
161
  }
162
162
  const content =
163
163
  `Found ${comments.length} comments:\n\n` +
164
164
  comments
165
165
  .map(
166
166
  (c) =>
167
- `- ID ${c.id}: By **${c.author_name}** on Post ${c.post} (${c.status})\n > ${c.content.rendered.substring(0, 100)}...`,
167
+ `- ID ${c.id}: By **${c.author_name}** on Post ${c.post} (${c.status})\n > ${c.content.rendered.substring(0, 100)}...`
168
168
  )
169
- .join("\n");
169
+ .join('\n');
170
170
  return content;
171
171
  } catch (error) {
172
172
  throw new Error(`Failed to list comments: ${getErrorMessage(error)}`);
@@ -175,7 +175,7 @@ export class CommentTools {
175
175
 
176
176
  public async handleGetComment(
177
177
  client: WordPressClient,
178
- params: { id: number },
178
+ params: { id: number }
179
179
  ): Promise<any> {
180
180
  try {
181
181
  const comment = await client.getComment(params.id);
@@ -194,7 +194,7 @@ export class CommentTools {
194
194
 
195
195
  public async handleCreateComment(
196
196
  client: WordPressClient,
197
- params: CreateCommentRequest,
197
+ params: CreateCommentRequest
198
198
  ): Promise<any> {
199
199
  try {
200
200
  const comment = await client.createComment(params);
@@ -206,7 +206,7 @@ export class CommentTools {
206
206
 
207
207
  public async handleUpdateComment(
208
208
  client: WordPressClient,
209
- params: UpdateCommentRequest & { id: number },
209
+ params: UpdateCommentRequest & { id: number }
210
210
  ): Promise<any> {
211
211
  try {
212
212
  const comment = await client.updateComment(params);
@@ -218,11 +218,11 @@ export class CommentTools {
218
218
 
219
219
  public async handleDeleteComment(
220
220
  client: WordPressClient,
221
- params: { id: number; force?: boolean },
221
+ params: { id: number; force?: boolean }
222
222
  ): Promise<any> {
223
223
  try {
224
224
  await client.deleteComment(params.id, params.force);
225
- const action = params.force ? "permanently deleted" : "moved to trash";
225
+ const action = params.force ? 'permanently deleted' : 'moved to trash';
226
226
  return `✅ Comment ${params.id} has been ${action}.`;
227
227
  } catch (error) {
228
228
  throw new Error(`Failed to delete comment: ${getErrorMessage(error)}`);
@@ -231,12 +231,12 @@ export class CommentTools {
231
231
 
232
232
  public async handleApproveComment(
233
233
  client: WordPressClient,
234
- params: { id: number },
234
+ params: { id: number }
235
235
  ): Promise<any> {
236
236
  try {
237
237
  const comment = await client.updateComment({
238
238
  id: params.id,
239
- status: "approved",
239
+ status: 'approved'
240
240
  });
241
241
  return `✅ Comment ${comment.id} has been approved.`;
242
242
  } catch (error) {
@@ -246,12 +246,12 @@ export class CommentTools {
246
246
 
247
247
  public async handleSpamComment(
248
248
  client: WordPressClient,
249
- params: { id: number },
249
+ params: { id: number }
250
250
  ): Promise<any> {
251
251
  try {
252
252
  const comment = await client.updateComment({
253
253
  id: params.id,
254
- status: "spam",
254
+ status: 'spam'
255
255
  });
256
256
  return `✅ Comment ${comment.id} has been marked as spam.`;
257
257
  } catch (error) {
@@ -1,13 +1,11 @@
1
- import * as fs from "fs";
2
- import * as path from "path";
3
- import { WordPressClient } from "../client/api.js";
1
+ import * as fs from 'fs';
2
+ import { WordPressClient } from '../client/api.js';
4
3
  import {
5
4
  MediaQueryParams,
6
5
  UpdateMediaRequest,
7
- UploadMediaRequest,
8
- WordPressMedia,
9
- } from "../types/wordpress.js";
10
- import { getErrorMessage } from "../utils/error.js";
6
+ UploadMediaRequest
7
+ } from '../types/wordpress.js';
8
+ import { getErrorMessage } from '../utils/error.js';
11
9
 
12
10
  /**
13
11
  * Provides tools for managing media on a WordPress site.
@@ -21,152 +19,152 @@ export class MediaTools {
21
19
  public getTools(): any[] {
22
20
  return [
23
21
  {
24
- name: "wp_list_media",
25
- description: "Lists media items from a WordPress site, with filters.",
22
+ name: 'wp_list_media',
23
+ description: 'Lists media items from a WordPress site, with filters.',
26
24
  parameters: [
27
25
  {
28
- name: "per_page",
29
- type: "number",
30
- description: "Number of items to return per page (max 100).",
26
+ name: 'per_page',
27
+ type: 'number',
28
+ description: 'Number of items to return per page (max 100).'
31
29
  },
32
30
  {
33
- name: "search",
34
- type: "string",
35
- description: "Limit results to those matching a search term.",
31
+ name: 'search',
32
+ type: 'string',
33
+ description: 'Limit results to those matching a search term.'
36
34
  },
37
35
  {
38
- name: "media_type",
39
- type: "string",
40
- description: "Limit results to a specific media type.",
41
- enum: ["image", "video", "audio", "application"],
42
- },
36
+ name: 'media_type',
37
+ type: 'string',
38
+ description: 'Limit results to a specific media type.',
39
+ enum: ['image', 'video', 'audio', 'application']
40
+ }
43
41
  ],
44
- handler: this.handleListMedia.bind(this),
42
+ handler: this.handleListMedia.bind(this)
45
43
  },
46
44
  {
47
- name: "wp_get_media",
48
- description: "Retrieves a single media item by its ID.",
45
+ name: 'wp_get_media',
46
+ description: 'Retrieves a single media item by its ID.',
49
47
  parameters: [
50
48
  {
51
- name: "id",
52
- type: "number",
49
+ name: 'id',
50
+ type: 'number',
53
51
  required: true,
54
- description: "The unique identifier for the media item.",
55
- },
52
+ description: 'The unique identifier for the media item.'
53
+ }
56
54
  ],
57
- handler: this.handleGetMedia.bind(this),
55
+ handler: this.handleGetMedia.bind(this)
58
56
  },
59
57
  {
60
- name: "wp_upload_media",
61
- description: "Uploads a file to the WordPress media library.",
58
+ name: 'wp_upload_media',
59
+ description: 'Uploads a file to the WordPress media library.',
62
60
  parameters: [
63
61
  {
64
- name: "file_path",
65
- type: "string",
62
+ name: 'file_path',
63
+ type: 'string',
66
64
  required: true,
67
- description: "The local, absolute path to the file to upload.",
65
+ description: 'The local, absolute path to the file to upload.'
68
66
  },
69
67
  {
70
- name: "title",
71
- type: "string",
72
- description: "The title for the media item.",
68
+ name: 'title',
69
+ type: 'string',
70
+ description: 'The title for the media item.'
73
71
  },
74
72
  {
75
- name: "alt_text",
76
- type: "string",
73
+ name: 'alt_text',
74
+ type: 'string',
77
75
  description:
78
- "Alternative text for the media item (for accessibility).",
76
+ 'Alternative text for the media item (for accessibility).'
79
77
  },
80
78
  {
81
- name: "caption",
82
- type: "string",
83
- description: "The caption for the media item.",
79
+ name: 'caption',
80
+ type: 'string',
81
+ description: 'The caption for the media item.'
84
82
  },
85
83
  {
86
- name: "description",
87
- type: "string",
88
- description: "The description for the media item.",
84
+ name: 'description',
85
+ type: 'string',
86
+ description: 'The description for the media item.'
89
87
  },
90
88
  {
91
- name: "post",
92
- type: "number",
93
- description: "The ID of a post to attach this media to.",
94
- },
89
+ name: 'post',
90
+ type: 'number',
91
+ description: 'The ID of a post to attach this media to.'
92
+ }
95
93
  ],
96
- handler: this.handleUploadMedia.bind(this),
94
+ handler: this.handleUploadMedia.bind(this)
97
95
  },
98
96
  {
99
- name: "wp_update_media",
100
- description: "Updates the metadata of an existing media item.",
97
+ name: 'wp_update_media',
98
+ description: 'Updates the metadata of an existing media item.',
101
99
  parameters: [
102
100
  {
103
- name: "id",
104
- type: "number",
101
+ name: 'id',
102
+ type: 'number',
105
103
  required: true,
106
- description: "The ID of the media item to update.",
104
+ description: 'The ID of the media item to update.'
107
105
  },
108
106
  {
109
- name: "title",
110
- type: "string",
111
- description: "The new title for the media item.",
107
+ name: 'title',
108
+ type: 'string',
109
+ description: 'The new title for the media item.'
112
110
  },
113
111
  {
114
- name: "alt_text",
115
- type: "string",
116
- description: "The new alternative text.",
112
+ name: 'alt_text',
113
+ type: 'string',
114
+ description: 'The new alternative text.'
117
115
  },
118
116
  {
119
- name: "caption",
120
- type: "string",
121
- description: "The new caption.",
117
+ name: 'caption',
118
+ type: 'string',
119
+ description: 'The new caption.'
122
120
  },
123
121
  {
124
- name: "description",
125
- type: "string",
126
- description: "The new description.",
127
- },
122
+ name: 'description',
123
+ type: 'string',
124
+ description: 'The new description.'
125
+ }
128
126
  ],
129
- handler: this.handleUpdateMedia.bind(this),
127
+ handler: this.handleUpdateMedia.bind(this)
130
128
  },
131
129
  {
132
- name: "wp_delete_media",
133
- description: "Deletes a media item.",
130
+ name: 'wp_delete_media',
131
+ description: 'Deletes a media item.',
134
132
  parameters: [
135
133
  {
136
- name: "id",
137
- type: "number",
134
+ name: 'id',
135
+ type: 'number',
138
136
  required: true,
139
- description: "The ID of the media item to delete.",
137
+ description: 'The ID of the media item to delete.'
140
138
  },
141
139
  {
142
- name: "force",
143
- type: "boolean",
140
+ name: 'force',
141
+ type: 'boolean',
144
142
  description:
145
- "If true, permanently delete. If false, move to trash. Defaults to false.",
146
- },
143
+ 'If true, permanently delete. If false, move to trash. Defaults to false.'
144
+ }
147
145
  ],
148
- handler: this.handleDeleteMedia.bind(this),
149
- },
146
+ handler: this.handleDeleteMedia.bind(this)
147
+ }
150
148
  ];
151
149
  }
152
150
 
153
151
  public async handleListMedia(
154
152
  client: WordPressClient,
155
- params: MediaQueryParams,
153
+ params: MediaQueryParams
156
154
  ): Promise<any> {
157
155
  try {
158
156
  const media = await client.getMedia(params);
159
157
  if (media.length === 0) {
160
- return "No media items found matching the criteria.";
158
+ return 'No media items found matching the criteria.';
161
159
  }
162
160
  const content =
163
161
  `Found ${media.length} media items:\n\n` +
164
162
  media
165
163
  .map(
166
164
  (m) =>
167
- `- ID ${m.id}: **${m.title.rendered}** (${m.mime_type})\n Link: ${m.source_url}`,
165
+ `- ID ${m.id}: **${m.title.rendered}** (${m.mime_type})\n Link: ${m.source_url}`
168
166
  )
169
- .join("\n");
167
+ .join('\n');
170
168
  return content;
171
169
  } catch (error) {
172
170
  throw new Error(`Failed to list media: ${getErrorMessage(error)}`);
@@ -175,7 +173,7 @@ export class MediaTools {
175
173
 
176
174
  public async handleGetMedia(
177
175
  client: WordPressClient,
178
- params: { id: number },
176
+ params: { id: number }
179
177
  ): Promise<any> {
180
178
  try {
181
179
  const media = await client.getMediaItem(params.id);
@@ -185,10 +183,10 @@ export class MediaTools {
185
183
  `- **URL:** ${media.source_url}\n` +
186
184
  `- **Type:** ${media.media_type} (${media.mime_type})\n` +
187
185
  `- **Date:** ${new Date(media.date).toLocaleString()}\n` +
188
- (media.alt_text ? `- **Alt Text:** ${media.alt_text}\n` : "") +
186
+ (media.alt_text ? `- **Alt Text:** ${media.alt_text}\n` : '') +
189
187
  (media.caption.rendered
190
188
  ? `- **Caption:** ${media.caption.rendered}\n`
191
- : "");
189
+ : '');
192
190
  return content;
193
191
  } catch (error) {
194
192
  throw new Error(`Failed to get media item: ${getErrorMessage(error)}`);
@@ -197,7 +195,7 @@ export class MediaTools {
197
195
 
198
196
  public async handleUploadMedia(
199
197
  client: WordPressClient,
200
- params: UploadMediaRequest & { file_path: string },
198
+ params: UploadMediaRequest & { file_path: string }
201
199
  ): Promise<any> {
202
200
  try {
203
201
  if (!fs.existsSync(params.file_path)) {
@@ -213,7 +211,7 @@ export class MediaTools {
213
211
 
214
212
  public async handleUpdateMedia(
215
213
  client: WordPressClient,
216
- params: UpdateMediaRequest & { id: number },
214
+ params: UpdateMediaRequest & { id: number }
217
215
  ): Promise<any> {
218
216
  try {
219
217
  const media = await client.updateMedia(params);
@@ -225,11 +223,11 @@ export class MediaTools {
225
223
 
226
224
  public async handleDeleteMedia(
227
225
  client: WordPressClient,
228
- params: { id: number; force?: boolean },
226
+ params: { id: number; force?: boolean }
229
227
  ): Promise<any> {
230
228
  try {
231
229
  await client.deleteMedia(params.id, params.force);
232
- const action = params.force ? "permanently deleted" : "moved to trash";
230
+ const action = params.force ? 'permanently deleted' : 'moved to trash';
233
231
  return `✅ Media item ${params.id} has been ${action}.`;
234
232
  } catch (error) {
235
233
  throw new Error(`Failed to delete media: ${getErrorMessage(error)}`);