esa_create_post
Create new posts in esa with titles, markdown content, tags, and categories to organize team documentation.
Instructions
Create a new post
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Post title | |
| body_md | No | Post body (Markdown format) | |
| tags | No | List of tags for the post | |
| category | No | Post category | |
| wip | No | Whether to mark as WIP (Work In Progress) | |
| message | No | Change message | |
| user | No | Poster's screen_name (only team owners can specify) | |
| template_post_id | No | ID of the post to use as a template |
Implementation Reference
- index.ts:502-511 (handler)Handler for the 'esa_create_post' tool in the CallToolRequest switch statement. Validates input and calls esaClient.createPost to execute the tool.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)Tool definition including name, description, and input schema for 'esa_create_post'.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 'esa_create_post' tool (via createPostTool) in the ListToolsRequest handler's tools array.tools: [ listPostsTool, getPostTool, createPostTool, updatePostTool, listCommentsTool, getCommentTool, createCommentTool, getMembersTool, getMemberTool, ], }; });
- index.ts:367-376 (helper)EsaClient method that performs the HTTP POST request to create a new post on the Esa API.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(); }
- index.ts:26-35 (schema)TypeScript interface defining the arguments for createPost, used for type validation in the handler.interface CreatePostArgs { name: string; body_md?: string; tags?: string[]; category?: string; wip?: boolean; message?: string; user?: string; template_post_id?: number; }