Skip to main content
Glama

esa_create_comment

Add a Markdown-formatted comment to a specific article using the post number, enabling collaborative discussions and feedback through the esa API integration.

Instructions

Post a comment to an article

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
body_mdYesComment body (Markdown format)
post_numberYesPost number to comment on
userNoPoster's screen_name (only team owners can specify)

Implementation Reference

  • Core handler function in EsaClient that executes the POST request to create a comment on the specified post using the Esa API.
    async createComment(post_number: number, body_md: string, user?: string): Promise<any> { const url = `${this.baseUrl}/posts/${post_number}/comments`; const commentData: { body_md: string; user?: string } = { body_md }; if (user) commentData.user = user; const response = await fetch(url, { method: "POST", headers: this.headers, body: JSON.stringify({ comment: commentData }), }); return response.json(); }
  • Tool definition for 'esa_create_comment' including name, description, and input schema.
    const createCommentTool: Tool = { name: "esa_create_comment", description: "Post a comment to an article", inputSchema: { type: "object", properties: { post_number: { type: "number", description: "Post number to comment on", }, body_md: { type: "string", description: "Comment body (Markdown format)", }, user: { type: "string", description: "Poster's screen_name (only team owners can specify)", }, }, required: ["post_number", "body_md"], }, };
  • Switch case in CallToolRequest handler that validates input arguments and invokes the EsaClient.createComment method.
    case "esa_create_comment": { const args = request.params.arguments as unknown as CreateCommentArgs; if (!args.post_number || !args.body_md) { throw new Error("post_number and body_md are required"); } const response = await esaClient.createComment( args.post_number, args.body_md, args.user ); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
  • TypeScript interface defining the arguments for creating a comment, used for type safety in the handler.
    interface CreateCommentArgs { post_number: number; body_md: string; user?: string; }
  • index.ts:607-617 (registration)
    Registration of the esa_create_comment tool (via createCommentTool) in the list of tools returned by ListToolsRequest handler.
    tools: [ listPostsTool, getPostTool, createPostTool, updatePostTool, listCommentsTool, getCommentTool, createCommentTool, getMembersTool, getMemberTool, ],

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kajirita2002/esa-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server