esa_update_post
Modify an existing post on the esa platform by updating its title, body, category, tags, or WIP status. Use this tool to make changes to posts efficiently within the esa MCP Server.
Instructions
Update an existing post
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body_md | No | New body for the post (Markdown format) | |
| category | No | New category for the post | |
| created_by | No | Poster's screen_name (only team owners can specify) | |
| message | No | Change message | |
| name | No | New title for the post | |
| original_revision | No | Revision to base the update on | |
| post_number | Yes | Post number to update | |
| tags | No | New list of tags for the post | |
| wip | No | Whether to mark as WIP (Work In Progress) |
Implementation Reference
- index.ts:513-523 (handler)Executes the esa_update_post tool: validates post_number, calls EsaClient.updatePost with destructured args, returns JSON 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:178-224 (schema)Tool definition including name, description, and detailed inputSchema for esa_update_post.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:378-387 (helper)EsaClient.updatePost method performs the HTTP PATCH request to the esa.io API to update the specified 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:37-47 (schema)TypeScript interface defining the structure of arguments for the updatePost tool.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:607-617 (registration)Registration of esa_update_post tool (as updatePostTool) in the list returned by ListToolsRequest handler.tools: [ listPostsTool, getPostTool, createPostTool, updatePostTool, listCommentsTool, getCommentTool, createCommentTool, getMembersTool, getMemberTool, ],