esa_create_post
Create a new post in esa with a title, markdown body, category, tags, and optional template. Mark as WIP or specify a poster for team owners.
Instructions
Create a new post
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body_md | No | Post body (Markdown format) | |
| category | No | Post category | |
| message | No | Change message | |
| name | Yes | Post title | |
| tags | No | List of tags for the post | |
| template_post_id | No | ID of the post to use as a template | |
| user | No | Poster's screen_name (only team owners can specify) | |
| wip | No | Whether to mark as WIP (Work In Progress) |
Implementation Reference
- index.ts:502-511 (handler)Handler for 'esa_create_post' tool: validates 'name' argument, calls esaClient.createPost(args), returns JSON response.case "esa_create_post": { const args = request.params.arguments as unknown as CreatePostArgs; if (!args.name) { throw new Error("name is required"); } const response = await esaClient.createPost(args); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
- index.ts:133-176 (schema)Schema definition for 'esa_create_post' tool including input schema with properties like name (required), body_md, tags, etc.const createPostTool: Tool = { name: "esa_create_post", description: "Create a new post", inputSchema: { type: "object", properties: { name: { type: "string", description: "Post title", }, body_md: { type: "string", description: "Post body (Markdown format)", }, tags: { type: "array", items: { type: "string" }, description: "List of tags for the post", }, category: { type: "string", description: "Post category", }, wip: { type: "boolean", description: "Whether to mark as WIP (Work In Progress)", default: true, }, message: { type: "string", description: "Change message", }, user: { type: "string", description: "Poster's screen_name (only team owners can specify)", }, template_post_id: { type: "number", description: "ID of the post to use as a template", }, }, required: ["name"], }, };
- index.ts:607-619 (registration)Registration of createPostTool (esa_create_post) in the tools list returned by ListToolsRequest handler.tools: [ listPostsTool, getPostTool, createPostTool, updatePostTool, listCommentsTool, getCommentTool, createCommentTool, getMembersTool, getMemberTool, ], }; });
- index.ts:367-376 (helper)EsaClient.createPost helper method: sends POST request to Esa API /posts endpoint with post data.async createPost(postData: Omit<CreatePostArgs, 'template_post_id'> & { template_post_id?: number }): Promise<any> { const url = `${this.baseUrl}/posts`; const response = await fetch(url, { method: "POST", headers: this.headers, body: JSON.stringify({ post: postData }), }); return response.json(); }