affine_delete_comment
Remove a specific comment from AFFiNE workspaces by providing its unique ID, ensuring clean and organized collaboration using the GraphQL API.
Instructions
Delete a comment by id.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/tools/comments.ts:116-120 (handler)The asynchronous handler function that executes the tool logic: sends a GraphQL mutation to delete the comment by ID and returns success status.const deleteCommentHandler = async (parsed: { id: string }) => { const mutation = `mutation DeleteComment($id:String!){ deleteComment(id:$id) }`; const data = await gql.request<{ deleteComment: boolean }>(mutation, { id: parsed.id }); return text({ success: data.deleteComment }); };
- src/tools/comments.ts:121-131 (registration)Registers the 'affine_delete_comment' tool with the MCP server, providing title, description, input schema, and linking to the handler function.server.registerTool( "affine_delete_comment", { title: "Delete Comment", description: "Delete a comment by id.", inputSchema: { id: z.string() } }, deleteCommentHandler as any );
- src/tools/comments.ts:127-128 (schema)Zod schema for input validation: requires a string 'id' parameter.id: z.string() }