delete_post
Remove a specific blog post from a Hexo blog by providing its filename. This action permanently deletes the post and cannot be reversed.
Instructions
删除指定的博客文章(不可撤销)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"filename": "<filename>"
},
"name": "delete_post"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | 要删除的文章文件名 |
Implementation Reference
- src/utils/post-manager.ts:179-182 (handler)The actual implementation of the delete operation, which resolves the file path and unlinks it from the filesystem.
export async function deletePost(filename: string): Promise<void> { const fullPath = postPath(filename); await fs.unlink(fullPath); } - src/tools/post-tools.ts:138-155 (registration)The MCP tool registration for "delete_post", which wraps the deletePost function and handles MCP tool communication.
// 删除文章 server.tool( "delete_post", "删除指定的博客文章(不可撤销)", { filename: z.string().describe("要删除的文章文件名") }, async ({ filename }) => { try { await deletePost(filename); return { content: [ { type: "text" as const, text: `🗑️ 文章 "${filename}" 已删除。建议执行 backup_source 备份更改。` }, ], }; } catch (e: any) { return { content: [{ type: "text" as const, text: `错误: ${e.message}` }], isError: true }; } } );