affine_update_comment
Modify comment content within AFFiNE workspaces using the GraphQL API. Input the comment ID and updated content to manage and refine collaborative discussions effectively.
Instructions
Update a comment content.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | No | ||
| id | Yes |
Implementation Reference
- src/tools/comments.ts:86-90 (handler)The async handler function that executes the GraphQL mutation to update a comment's content and returns success status.const updateCommentHandler = async (parsed: { id: string; content: any }) => { const mutation = `mutation UpdateComment($input: CommentUpdateInput!){ updateComment(input:$input) }`; const data = await gql.request<{ updateComment: boolean }>(mutation, { input: { id: parsed.id, content: parsed.content } }); return text({ success: data.updateComment }); };
- src/tools/comments.ts:91-102 (registration)Registration of the 'affine_update_comment' tool using server.registerTool, specifying title, description, Zod input schema, and linking to the shared updateCommentHandler.server.registerTool( "affine_update_comment", { title: "Update Comment", description: "Update a comment content.", inputSchema: { id: z.string(), content: z.any() } }, updateCommentHandler as any );
- src/tools/comments.ts:93-100 (schema)Input schema definition using Zod for the tool: requires 'id' (string) and 'content' (any).{ title: "Update Comment", description: "Update a comment content.", inputSchema: { id: z.string(), content: z.any() } },