@kieksme/mcp-hashnode 1.1.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.
- package/README.md +187 -0
- package/dist/constants.d.ts +3 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +3 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -0
- package/dist/services/hashnode.d.ts +9 -0
- package/dist/services/hashnode.d.ts.map +1 -0
- package/dist/services/hashnode.js +61 -0
- package/dist/services/hashnode.js.map +1 -0
- package/dist/tools/drafts.d.ts +3 -0
- package/dist/tools/drafts.d.ts.map +1 -0
- package/dist/tools/drafts.js +449 -0
- package/dist/tools/drafts.js.map +1 -0
- package/dist/tools/posts.d.ts +3 -0
- package/dist/tools/posts.d.ts.map +1 -0
- package/dist/tools/posts.js +536 -0
- package/dist/tools/posts.js.map +1 -0
- package/dist/tools/publications.d.ts +3 -0
- package/dist/tools/publications.d.ts.map +1 -0
- package/dist/tools/publications.js +183 -0
- package/dist/tools/publications.js.map +1 -0
- package/dist/types.d.ts +87 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1,536 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { gql } from "../services/hashnode.js";
|
|
3
|
+
import { CHARACTER_LIMIT } from "../constants.js";
|
|
4
|
+
var ResponseFormat;
|
|
5
|
+
(function (ResponseFormat) {
|
|
6
|
+
ResponseFormat["MARKDOWN"] = "markdown";
|
|
7
|
+
ResponseFormat["JSON"] = "json";
|
|
8
|
+
})(ResponseFormat || (ResponseFormat = {}));
|
|
9
|
+
const ResponseFormatSchema = z
|
|
10
|
+
.nativeEnum(ResponseFormat)
|
|
11
|
+
.default(ResponseFormat.MARKDOWN)
|
|
12
|
+
.describe("Output format: 'markdown' (default) or 'json'");
|
|
13
|
+
const TagInputSchema = z.object({
|
|
14
|
+
name: z.string().describe("Tag display name, e.g. 'Cloud Computing'"),
|
|
15
|
+
slug: z
|
|
16
|
+
.string()
|
|
17
|
+
.describe("Tag slug (lowercase, hyphens), e.g. 'cloud-computing'"),
|
|
18
|
+
});
|
|
19
|
+
// ─── Queries & Mutations ──────────────────────────────────────────────────────
|
|
20
|
+
const LIST_POSTS_QUERY = `
|
|
21
|
+
query ($host: String!, $first: Int!, $after: String) {
|
|
22
|
+
publication(host: $host) {
|
|
23
|
+
posts(first: $first, after: $after) {
|
|
24
|
+
edges {
|
|
25
|
+
node {
|
|
26
|
+
id
|
|
27
|
+
title
|
|
28
|
+
subtitle
|
|
29
|
+
slug
|
|
30
|
+
url
|
|
31
|
+
publishedAt
|
|
32
|
+
readTimeInMinutes
|
|
33
|
+
views
|
|
34
|
+
tags { id name slug }
|
|
35
|
+
coverImage { url }
|
|
36
|
+
}
|
|
37
|
+
cursor
|
|
38
|
+
}
|
|
39
|
+
pageInfo { hasNextPage endCursor }
|
|
40
|
+
totalDocuments
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
45
|
+
const GET_POST_QUERY = `
|
|
46
|
+
query ($host: String!, $slug: String!) {
|
|
47
|
+
publication(host: $host) {
|
|
48
|
+
post(slug: $slug) {
|
|
49
|
+
id
|
|
50
|
+
title
|
|
51
|
+
subtitle
|
|
52
|
+
slug
|
|
53
|
+
url
|
|
54
|
+
brief
|
|
55
|
+
publishedAt
|
|
56
|
+
updatedAt
|
|
57
|
+
readTimeInMinutes
|
|
58
|
+
views
|
|
59
|
+
tags { id name slug }
|
|
60
|
+
coverImage { url }
|
|
61
|
+
author { name username }
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
`;
|
|
66
|
+
const PUBLISH_POST_MUTATION = `
|
|
67
|
+
mutation ($input: PublishPostInput!) {
|
|
68
|
+
publishPost(input: $input) {
|
|
69
|
+
post {
|
|
70
|
+
id
|
|
71
|
+
title
|
|
72
|
+
subtitle
|
|
73
|
+
slug
|
|
74
|
+
url
|
|
75
|
+
publishedAt
|
|
76
|
+
tags { id name slug }
|
|
77
|
+
coverImage { url }
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
`;
|
|
82
|
+
const UPDATE_POST_MUTATION = `
|
|
83
|
+
mutation ($input: UpdatePostInput!) {
|
|
84
|
+
updatePost(input: $input) {
|
|
85
|
+
post {
|
|
86
|
+
id
|
|
87
|
+
title
|
|
88
|
+
subtitle
|
|
89
|
+
slug
|
|
90
|
+
url
|
|
91
|
+
updatedAt
|
|
92
|
+
tags { id name slug }
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
`;
|
|
97
|
+
const REMOVE_POST_MUTATION = `
|
|
98
|
+
mutation ($input: RemovePostInput!) {
|
|
99
|
+
removePost(input: $input) {
|
|
100
|
+
post {
|
|
101
|
+
id
|
|
102
|
+
title
|
|
103
|
+
slug
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
`;
|
|
108
|
+
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
|
109
|
+
function formatPost(post, verbose = false) {
|
|
110
|
+
const lines = [
|
|
111
|
+
`## ${post.title}`,
|
|
112
|
+
`**ID**: \`${post.id}\``,
|
|
113
|
+
`**URL**: ${post.url}`,
|
|
114
|
+
`**Slug**: ${post.slug}`,
|
|
115
|
+
];
|
|
116
|
+
if (post.subtitle)
|
|
117
|
+
lines.push(`**Subtitle**: ${post.subtitle}`);
|
|
118
|
+
if (post.publishedAt)
|
|
119
|
+
lines.push(`**Published**: ${new Date(post.publishedAt).toLocaleString()}`);
|
|
120
|
+
if (post.readTimeInMinutes !== undefined)
|
|
121
|
+
lines.push(`**Read time**: ${post.readTimeInMinutes} min`);
|
|
122
|
+
if (post.views !== undefined)
|
|
123
|
+
lines.push(`**Views**: ${post.views.toLocaleString()}`);
|
|
124
|
+
if (post.tags?.length)
|
|
125
|
+
lines.push(`**Tags**: ${post.tags.map((t) => t.name).join(", ")}`);
|
|
126
|
+
if (post.coverImage?.url)
|
|
127
|
+
lines.push(`**Cover**: ${post.coverImage.url}`);
|
|
128
|
+
if (verbose && post.brief) {
|
|
129
|
+
lines.push("", "**Brief**:", post.brief);
|
|
130
|
+
}
|
|
131
|
+
return lines.join("\n");
|
|
132
|
+
}
|
|
133
|
+
// ─── Register ─────────────────────────────────────────────────────────────────
|
|
134
|
+
export function registerPostTools(server) {
|
|
135
|
+
// hashnode_list_posts ──────────────────────────────────────────────────────
|
|
136
|
+
server.registerTool("hashnode_list_posts", {
|
|
137
|
+
title: "List published posts in a Hashnode publication",
|
|
138
|
+
description: `List published blog posts in a publication, ordered by publish date (newest first).
|
|
139
|
+
|
|
140
|
+
Args:
|
|
141
|
+
- host (string, required): Publication host, e.g. "yourblog.hashnode.dev"
|
|
142
|
+
- limit (number): Posts per page (default 20, max 50)
|
|
143
|
+
- after (string): Cursor for pagination
|
|
144
|
+
- response_format: 'markdown' or 'json'
|
|
145
|
+
|
|
146
|
+
Returns: posts with id, title, slug, url, publishedAt, views, readTime, tags`,
|
|
147
|
+
inputSchema: {
|
|
148
|
+
host: z
|
|
149
|
+
.string()
|
|
150
|
+
.min(1)
|
|
151
|
+
.describe("Publication host, e.g. 'yourblog.hashnode.dev'"),
|
|
152
|
+
limit: z.number().int().min(1).max(50).default(20).describe("Posts per page"),
|
|
153
|
+
after: z
|
|
154
|
+
.string()
|
|
155
|
+
.optional()
|
|
156
|
+
.describe("Pagination cursor from previous response"),
|
|
157
|
+
response_format: ResponseFormatSchema,
|
|
158
|
+
},
|
|
159
|
+
annotations: {
|
|
160
|
+
readOnlyHint: true,
|
|
161
|
+
destructiveHint: false,
|
|
162
|
+
idempotentHint: true,
|
|
163
|
+
openWorldHint: true,
|
|
164
|
+
},
|
|
165
|
+
}, async ({ host, limit, after, response_format }) => {
|
|
166
|
+
try {
|
|
167
|
+
const data = await gql(LIST_POSTS_QUERY, { host, first: limit, after: after ?? null });
|
|
168
|
+
const posts = data.publication?.posts;
|
|
169
|
+
if (!posts) {
|
|
170
|
+
return {
|
|
171
|
+
content: [
|
|
172
|
+
{
|
|
173
|
+
type: "text",
|
|
174
|
+
text: `Error: No publication found for host '${host}'.`,
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
const items = posts.edges.map((e) => e.node);
|
|
180
|
+
if (response_format === ResponseFormat.JSON) {
|
|
181
|
+
const output = {
|
|
182
|
+
total: posts.totalDocuments,
|
|
183
|
+
count: items.length,
|
|
184
|
+
posts: items,
|
|
185
|
+
has_more: posts.pageInfo.hasNextPage,
|
|
186
|
+
next_cursor: posts.pageInfo.endCursor,
|
|
187
|
+
};
|
|
188
|
+
let text = JSON.stringify(output, null, 2);
|
|
189
|
+
if (text.length > CHARACTER_LIMIT) {
|
|
190
|
+
const trimmed = { ...output, posts: items.slice(0, 5), truncated: true };
|
|
191
|
+
text = JSON.stringify(trimmed, null, 2);
|
|
192
|
+
}
|
|
193
|
+
return {
|
|
194
|
+
content: [{ type: "text", text }],
|
|
195
|
+
structuredContent: output,
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
if (items.length === 0) {
|
|
199
|
+
return { content: [{ type: "text", text: "No published posts found." }] };
|
|
200
|
+
}
|
|
201
|
+
const lines = [
|
|
202
|
+
`# Posts in ${host} (${posts.totalDocuments} total)`,
|
|
203
|
+
"",
|
|
204
|
+
...items.map((p) => formatPost(p)),
|
|
205
|
+
"",
|
|
206
|
+
];
|
|
207
|
+
if (posts.pageInfo.hasNextPage) {
|
|
208
|
+
lines.push(`_More posts available. Use cursor: \`${posts.pageInfo.endCursor}\`_`);
|
|
209
|
+
}
|
|
210
|
+
return { content: [{ type: "text", text: lines.join("\n") }] };
|
|
211
|
+
}
|
|
212
|
+
catch (error) {
|
|
213
|
+
return {
|
|
214
|
+
content: [
|
|
215
|
+
{
|
|
216
|
+
type: "text",
|
|
217
|
+
text: error instanceof Error ? error.message : String(error),
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
// hashnode_get_post ────────────────────────────────────────────────────────
|
|
224
|
+
server.registerTool("hashnode_get_post", {
|
|
225
|
+
title: "Get a single Hashnode post by slug",
|
|
226
|
+
description: `Fetch full details of a published post by its slug.
|
|
227
|
+
|
|
228
|
+
Args:
|
|
229
|
+
- host (string, required): Publication host
|
|
230
|
+
- slug (string, required): Post slug from the URL, e.g. "my-first-post"
|
|
231
|
+
- response_format: 'markdown' or 'json'
|
|
232
|
+
|
|
233
|
+
Returns: full post data including content brief, views, tags, cover image, author`,
|
|
234
|
+
inputSchema: {
|
|
235
|
+
host: z.string().min(1).describe("Publication host"),
|
|
236
|
+
slug: z.string().min(1).describe("Post slug from URL"),
|
|
237
|
+
response_format: ResponseFormatSchema,
|
|
238
|
+
},
|
|
239
|
+
annotations: {
|
|
240
|
+
readOnlyHint: true,
|
|
241
|
+
destructiveHint: false,
|
|
242
|
+
idempotentHint: true,
|
|
243
|
+
openWorldHint: true,
|
|
244
|
+
},
|
|
245
|
+
}, async ({ host, slug, response_format }) => {
|
|
246
|
+
try {
|
|
247
|
+
const data = await gql(GET_POST_QUERY, { host, slug });
|
|
248
|
+
const post = data.publication?.post;
|
|
249
|
+
if (!post) {
|
|
250
|
+
return {
|
|
251
|
+
content: [
|
|
252
|
+
{
|
|
253
|
+
type: "text",
|
|
254
|
+
text: `Error: No post found with slug '${slug}' in '${host}'.`,
|
|
255
|
+
},
|
|
256
|
+
],
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
if (response_format === ResponseFormat.JSON) {
|
|
260
|
+
return {
|
|
261
|
+
content: [{ type: "text", text: JSON.stringify(post, null, 2) }],
|
|
262
|
+
structuredContent: post,
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
return {
|
|
266
|
+
content: [
|
|
267
|
+
{ type: "text", text: formatPost(post, true) },
|
|
268
|
+
],
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
catch (error) {
|
|
272
|
+
return {
|
|
273
|
+
content: [
|
|
274
|
+
{
|
|
275
|
+
type: "text",
|
|
276
|
+
text: error instanceof Error ? error.message : String(error),
|
|
277
|
+
},
|
|
278
|
+
],
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
// hashnode_publish_post ────────────────────────────────────────────────────
|
|
283
|
+
server.registerTool("hashnode_publish_post", {
|
|
284
|
+
title: "Publish a post directly to Hashnode (no draft step)",
|
|
285
|
+
description: `Publish a new blog post directly without creating a draft first.
|
|
286
|
+
Prefer hashnode_create_draft + hashnode_publish_draft for a safer workflow.
|
|
287
|
+
|
|
288
|
+
Args:
|
|
289
|
+
- publication_id (string, required): Publication ID (from hashnode_get_me)
|
|
290
|
+
- title (string, required): Post title
|
|
291
|
+
- content_markdown (string, required): Post content in Markdown
|
|
292
|
+
- subtitle (string, optional): Short subtitle
|
|
293
|
+
- tags (array, optional): [{ name, slug }] — max 5 tags
|
|
294
|
+
- cover_image_url (string, optional): URL of cover image
|
|
295
|
+
- slug (string, optional): Custom URL slug
|
|
296
|
+
- original_article_url (string, optional): Canonical URL for cross-posts
|
|
297
|
+
- meta_title (string, optional): SEO title
|
|
298
|
+
- meta_description (string, optional): SEO description
|
|
299
|
+
- scheduled_at (string, optional): ISO 8601 datetime for scheduled publishing
|
|
300
|
+
- response_format: 'markdown' or 'json'
|
|
301
|
+
|
|
302
|
+
Returns: post id, title, slug, url, publishedAt, tags`,
|
|
303
|
+
inputSchema: {
|
|
304
|
+
publication_id: z.string().min(1).describe("Publication ID"),
|
|
305
|
+
title: z.string().min(1).max(1000).describe("Post title"),
|
|
306
|
+
content_markdown: z
|
|
307
|
+
.string()
|
|
308
|
+
.min(1)
|
|
309
|
+
.describe("Post content in Markdown"),
|
|
310
|
+
subtitle: z
|
|
311
|
+
.string()
|
|
312
|
+
.max(300)
|
|
313
|
+
.optional()
|
|
314
|
+
.describe("Short subtitle"),
|
|
315
|
+
tags: z
|
|
316
|
+
.array(TagInputSchema)
|
|
317
|
+
.max(5)
|
|
318
|
+
.optional()
|
|
319
|
+
.describe("Tags as [{ name: 'Cloud Computing', slug: 'cloud-computing' }]"),
|
|
320
|
+
cover_image_url: z
|
|
321
|
+
.string()
|
|
322
|
+
.url()
|
|
323
|
+
.optional()
|
|
324
|
+
.describe("URL of cover image"),
|
|
325
|
+
slug: z.string().optional().describe("Custom URL slug"),
|
|
326
|
+
original_article_url: z
|
|
327
|
+
.string()
|
|
328
|
+
.url()
|
|
329
|
+
.optional()
|
|
330
|
+
.describe("Canonical URL for cross-posted content"),
|
|
331
|
+
meta_title: z.string().max(250).optional().describe("SEO meta title"),
|
|
332
|
+
meta_description: z
|
|
333
|
+
.string()
|
|
334
|
+
.max(500)
|
|
335
|
+
.optional()
|
|
336
|
+
.describe("SEO meta description"),
|
|
337
|
+
scheduled_at: z
|
|
338
|
+
.string()
|
|
339
|
+
.optional()
|
|
340
|
+
.describe("ISO 8601 datetime for scheduled publishing, e.g. '2025-12-31T10:00:00Z'"),
|
|
341
|
+
response_format: ResponseFormatSchema,
|
|
342
|
+
},
|
|
343
|
+
annotations: {
|
|
344
|
+
readOnlyHint: false,
|
|
345
|
+
destructiveHint: false,
|
|
346
|
+
idempotentHint: false,
|
|
347
|
+
openWorldHint: true,
|
|
348
|
+
},
|
|
349
|
+
}, async ({ publication_id, title, content_markdown, subtitle, tags, cover_image_url, slug, original_article_url, meta_title, meta_description, scheduled_at, response_format, }) => {
|
|
350
|
+
try {
|
|
351
|
+
const input = {
|
|
352
|
+
publicationId: publication_id,
|
|
353
|
+
title,
|
|
354
|
+
contentMarkdown: content_markdown,
|
|
355
|
+
};
|
|
356
|
+
if (subtitle)
|
|
357
|
+
input.subtitle = subtitle;
|
|
358
|
+
if (tags?.length)
|
|
359
|
+
input.tags = tags;
|
|
360
|
+
if (cover_image_url)
|
|
361
|
+
input.coverImageOptions = { coverImageURL: cover_image_url };
|
|
362
|
+
if (slug)
|
|
363
|
+
input.slug = slug;
|
|
364
|
+
if (original_article_url)
|
|
365
|
+
input.originalArticleURL = original_article_url;
|
|
366
|
+
if (meta_title || meta_description) {
|
|
367
|
+
input.metaTags = {
|
|
368
|
+
...(meta_title ? { title: meta_title } : {}),
|
|
369
|
+
...(meta_description ? { description: meta_description } : {}),
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
if (scheduled_at)
|
|
373
|
+
input.publishedAt = scheduled_at;
|
|
374
|
+
const data = await gql(PUBLISH_POST_MUTATION, { input });
|
|
375
|
+
const post = data.publishPost.post;
|
|
376
|
+
if (response_format === ResponseFormat.JSON) {
|
|
377
|
+
return {
|
|
378
|
+
content: [{ type: "text", text: JSON.stringify(post, null, 2) }],
|
|
379
|
+
structuredContent: post,
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
return {
|
|
383
|
+
content: [
|
|
384
|
+
{
|
|
385
|
+
type: "text",
|
|
386
|
+
text: ["# 🚀 Post published!", "", formatPost(post)].join("\n"),
|
|
387
|
+
},
|
|
388
|
+
],
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
catch (error) {
|
|
392
|
+
return {
|
|
393
|
+
content: [
|
|
394
|
+
{
|
|
395
|
+
type: "text",
|
|
396
|
+
text: error instanceof Error ? error.message : String(error),
|
|
397
|
+
},
|
|
398
|
+
],
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
// hashnode_update_post ─────────────────────────────────────────────────────
|
|
403
|
+
server.registerTool("hashnode_update_post", {
|
|
404
|
+
title: "Update a published Hashnode post",
|
|
405
|
+
description: `Update fields of an already-published post. Only provided fields are changed.
|
|
406
|
+
|
|
407
|
+
Args:
|
|
408
|
+
- post_id (string, required): Post ID (from hashnode_list_posts or hashnode_get_post)
|
|
409
|
+
- title (string, optional): New title
|
|
410
|
+
- content_markdown (string, optional): New content in Markdown
|
|
411
|
+
- subtitle (string, optional): New subtitle
|
|
412
|
+
- tags (array, optional): New tags [{ name, slug }]
|
|
413
|
+
- cover_image_url (string, optional): New cover image URL
|
|
414
|
+
- response_format: 'markdown' or 'json'`,
|
|
415
|
+
inputSchema: {
|
|
416
|
+
post_id: z.string().min(1).describe("Post ID to update"),
|
|
417
|
+
title: z.string().min(1).max(1000).optional().describe("New title"),
|
|
418
|
+
content_markdown: z
|
|
419
|
+
.string()
|
|
420
|
+
.optional()
|
|
421
|
+
.describe("New content in Markdown"),
|
|
422
|
+
subtitle: z.string().max(300).optional().describe("New subtitle"),
|
|
423
|
+
tags: z
|
|
424
|
+
.array(TagInputSchema)
|
|
425
|
+
.max(5)
|
|
426
|
+
.optional()
|
|
427
|
+
.describe("New tags [{ name, slug }]"),
|
|
428
|
+
cover_image_url: z
|
|
429
|
+
.string()
|
|
430
|
+
.url()
|
|
431
|
+
.optional()
|
|
432
|
+
.describe("New cover image URL"),
|
|
433
|
+
response_format: ResponseFormatSchema,
|
|
434
|
+
},
|
|
435
|
+
annotations: {
|
|
436
|
+
readOnlyHint: false,
|
|
437
|
+
destructiveHint: false,
|
|
438
|
+
idempotentHint: false,
|
|
439
|
+
openWorldHint: true,
|
|
440
|
+
},
|
|
441
|
+
}, async ({ post_id, title, content_markdown, subtitle, tags, cover_image_url, response_format, }) => {
|
|
442
|
+
try {
|
|
443
|
+
const input = { id: post_id };
|
|
444
|
+
if (title !== undefined)
|
|
445
|
+
input.title = title;
|
|
446
|
+
if (content_markdown !== undefined)
|
|
447
|
+
input.contentMarkdown = content_markdown;
|
|
448
|
+
if (subtitle !== undefined)
|
|
449
|
+
input.subtitle = subtitle;
|
|
450
|
+
if (tags !== undefined)
|
|
451
|
+
input.tags = tags;
|
|
452
|
+
if (cover_image_url !== undefined)
|
|
453
|
+
input.coverImageOptions = { coverImageURL: cover_image_url };
|
|
454
|
+
const data = await gql(UPDATE_POST_MUTATION, { input });
|
|
455
|
+
const post = data.updatePost.post;
|
|
456
|
+
if (response_format === ResponseFormat.JSON) {
|
|
457
|
+
return {
|
|
458
|
+
content: [{ type: "text", text: JSON.stringify(post, null, 2) }],
|
|
459
|
+
structuredContent: post,
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
return {
|
|
463
|
+
content: [
|
|
464
|
+
{
|
|
465
|
+
type: "text",
|
|
466
|
+
text: ["# ✅ Post updated", "", formatPost(post)].join("\n"),
|
|
467
|
+
},
|
|
468
|
+
],
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
catch (error) {
|
|
472
|
+
return {
|
|
473
|
+
content: [
|
|
474
|
+
{
|
|
475
|
+
type: "text",
|
|
476
|
+
text: error instanceof Error ? error.message : String(error),
|
|
477
|
+
},
|
|
478
|
+
],
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
});
|
|
482
|
+
// hashnode_delete_post ─────────────────────────────────────────────────────
|
|
483
|
+
server.registerTool("hashnode_delete_post", {
|
|
484
|
+
title: "Delete a published Hashnode post",
|
|
485
|
+
description: `Permanently delete a published post. This action cannot be undone.
|
|
486
|
+
|
|
487
|
+
Args:
|
|
488
|
+
- post_id (string, required): Post ID to delete
|
|
489
|
+
- response_format: 'markdown' or 'json'
|
|
490
|
+
|
|
491
|
+
⚠️ WARNING: This permanently deletes the post.`,
|
|
492
|
+
inputSchema: {
|
|
493
|
+
post_id: z
|
|
494
|
+
.string()
|
|
495
|
+
.min(1)
|
|
496
|
+
.describe("Post ID to permanently delete"),
|
|
497
|
+
response_format: ResponseFormatSchema,
|
|
498
|
+
},
|
|
499
|
+
annotations: {
|
|
500
|
+
readOnlyHint: false,
|
|
501
|
+
destructiveHint: true,
|
|
502
|
+
idempotentHint: false,
|
|
503
|
+
openWorldHint: true,
|
|
504
|
+
},
|
|
505
|
+
}, async ({ post_id, response_format }) => {
|
|
506
|
+
try {
|
|
507
|
+
const data = await gql(REMOVE_POST_MUTATION, { input: { id: post_id } });
|
|
508
|
+
const post = data.removePost.post;
|
|
509
|
+
if (response_format === ResponseFormat.JSON) {
|
|
510
|
+
return {
|
|
511
|
+
content: [{ type: "text", text: JSON.stringify(post, null, 2) }],
|
|
512
|
+
structuredContent: post,
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
return {
|
|
516
|
+
content: [
|
|
517
|
+
{
|
|
518
|
+
type: "text",
|
|
519
|
+
text: `# 🗑️ Post deleted\n\n**"${post.title}"** (ID: \`${post.id}\`) has been permanently deleted.`,
|
|
520
|
+
},
|
|
521
|
+
],
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
catch (error) {
|
|
525
|
+
return {
|
|
526
|
+
content: [
|
|
527
|
+
{
|
|
528
|
+
type: "text",
|
|
529
|
+
text: error instanceof Error ? error.message : String(error),
|
|
530
|
+
},
|
|
531
|
+
],
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
//# sourceMappingURL=posts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posts.js","sourceRoot":"","sources":["../../src/tools/posts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGlD,IAAK,cAGJ;AAHD,WAAK,cAAc;IACjB,uCAAqB,CAAA;IACrB,+BAAa,CAAA;AACf,CAAC,EAHI,cAAc,KAAd,cAAc,QAGlB;AAED,MAAM,oBAAoB,GAAG,CAAC;KAC3B,UAAU,CAAC,cAAc,CAAC;KAC1B,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC;KAChC,QAAQ,CAAC,+CAA+C,CAAC,CAAC;AAE7D,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,IAAI,EAAE,CAAC,CAAC,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