write_comment
Add comments to BAND posts using band and post identifiers with specified content to engage with group discussions.
Instructions
Write a comment to BAND post.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| band_key | Yes | band identifier | |
| body | Yes | comment content | |
| post_key | Yes | post identifier |
Implementation Reference
- src/writeComment/tool.ts:61-72 (handler)The main handler function that executes the write_comment tool by calling the BAND API to create a comment and returning the formatted response.export async function handleToolCall(band_key: string, post_key: string, body: string) { const commentData = await bandApiClient.post<WriteCommentResponse>( '/v2/band/post/comment/create', { band_key, post_key, body } ); return { content: [{ type: "text", text: JSON.stringify(commentData, null, 2) }] }; }
- src/writeComment/tool.ts:8-52 (schema)Defines the ToolDefinition including inputSchema (band_key, post_key, body) and outputSchema (result_code, result_data with comment_key) for the write_comment tool.export const ToolDefinition : Tool = { name: "write_comment", description: "Write a comment to BAND post.", inputSchema: { type: "object", properties: { band_key: { type: "string", title: "Band Key", description: "band identifier" }, post_key: { type: "string", title: "Post Key", description: "post identifier" }, body: { type: "string", title: "Body", description: "comment content" } }, required: ["band_key", "post_key", "body"] }, outputSchema: { type: "object", properties: { result_code: { type: "number", description: "Result code" }, result_data: { type: "object", description: "Result data", properties: { comment_key: { type: "string", description: "created comment identifier" } } } }, required: ["result_code", "result_data"] } };
- src/tools.ts:67-72 (registration)Registers the dispatching of 'write_comment' tool calls to the specific handleToolCall function in the main tools handler.case "write_comment": return writeComment.handleToolCall( a.band_key as string, a.post_key as string, a.body as string );
- src/tools.ts:15-28 (registration)Registers the ToolDefinition of write_comment in the array of available BAND tools.export const bandTools: Tool[] = [ profile.ToolDefinition, bands.ToolDefinition, posts.ToolDefinition, post.ToolDefinition, comments.ToolDefinition, permissions.ToolDefinition, albums.ToolDefinition, photos.ToolDefinition, writeComment.ToolDefinition, writePost.ToolDefinition, removePost.ToolDefinition, removeComment.ToolDefinition, ];
- src/writeComment/index.ts:1-5 (helper)Helper module that re-exports ToolDefinition and handleToolCall from tool.ts for easy import in the main tools file.import {ToolDefinition, handleToolCall} from "./tool.js"; const writeComment = {ToolDefinition, handleToolCall} export default writeComment;