esa_update_post
Modify existing posts in esa by updating content, title, tags, category, or status using post number identification.
Instructions
Update an existing post
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| post_number | Yes | Post number to update | |
| name | No | New title for the post | |
| body_md | No | New body for the post (Markdown format) | |
| tags | No | New list of tags for the post | |
| category | No | New category for the post | |
| wip | No | Whether to mark as WIP (Work In Progress) | |
| message | No | Change message | |
| created_by | No | Poster's screen_name (only team owners can specify) | |
| original_revision | No | Revision to base the update on |
Implementation Reference
- index.ts:513-523 (handler)MCP tool dispatcher case for 'esa_update_post': validates arguments, calls EsaClient.updatePost, and formats the response.case "esa_update_post": { const args = request.params.arguments as unknown as UpdatePostArgs; if (!args.post_number) { throw new Error("post_number is required"); } const { post_number, ...postData } = args; const response = await esaClient.updatePost(post_number, postData); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
- index.ts:378-387 (handler)EsaClient method that executes the HTTP PATCH request to update an existing esa post.async updatePost(post_number: number, postData: Omit<UpdatePostArgs, 'post_number'>): Promise<any> { const url = `${this.baseUrl}/posts/${post_number}`; const response = await fetch(url, { method: "PATCH", headers: this.headers, body: JSON.stringify({ post: postData }), }); return response.json(); }
- index.ts:178-224 (schema)Tool definition object for 'esa_update_post' including name, description, and input schema.const updatePostTool: Tool = { name: "esa_update_post", description: "Update an existing post", inputSchema: { type: "object", properties: { post_number: { type: "number", description: "Post number to update", }, name: { type: "string", description: "New title for the post", }, body_md: { type: "string", description: "New body for the post (Markdown format)", }, tags: { type: "array", items: { type: "string" }, description: "New list of tags for the post", }, category: { type: "string", description: "New category for the post", }, wip: { type: "boolean", description: "Whether to mark as WIP (Work In Progress)", }, message: { type: "string", description: "Change message", }, created_by: { type: "string", description: "Poster's screen_name (only team owners can specify)", }, original_revision: { type: "string", description: "Revision to base the update on", }, }, required: ["post_number"], }, };
- index.ts:37-47 (schema)TypeScript interface defining the arguments for updating a post.interface UpdatePostArgs { post_number: number; name?: string; body_md?: string; tags?: string[]; category?: string; wip?: boolean; message?: string; created_by?: string; original_revision?: string; }
- index.ts:604-619 (registration)Registers 'esa_update_post' tool (via updatePostTool) in the ListTools response.server.setRequestHandler(ListToolsRequestSchema, async () => { console.error("ListToolsRequest received"); return { tools: [ listPostsTool, getPostTool, createPostTool, updatePostTool, listCommentsTool, getCommentTool, createCommentTool, getMembersTool, getMemberTool, ], }; });