Delete Comment
delete_commentDelete a comment from an AFFiNE workspace by providing its unique identifier.
Instructions
Delete a comment by id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/tools/comments.ts:86-94 (handler)The deleteCommentHandler function that executes the delete_comment tool logic. It performs a GraphQL mutation to delete a comment by ID and returns a receipt with 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 receipt("comment.delete", { commentId: parsed.id, id: parsed.id, success: data.deleteComment, }); }; - src/tools/comments.ts:95-105 (schema)Registration of delete_comment tool with its input schema (id: z.string()) and description.
server.registerTool( "delete_comment", { title: "Delete Comment", description: "Delete a comment by id.", inputSchema: { id: z.string() } }, deleteCommentHandler as any ); - src/tools/comments.ts:95-105 (registration)The delete_comment tool is registered via server.registerTool with the name "delete_comment", its schema, and the deleteCommentHandler.
server.registerTool( "delete_comment", { title: "Delete Comment", description: "Delete a comment by id.", inputSchema: { id: z.string() } }, deleteCommentHandler as any ); - src/util/mcp.ts:26-32 (helper)The receipt helper function used by the handler to build a standard success response.
export function receipt(kind: string, data: Record<string, unknown>) { return text({ kind, ok: true, ...data, }); } - src/toolSurface.ts:117-117 (registration)Tool group classification: delete_comment is categorized under comments, comments.write, destructive, write.
delete_comment: ["comments", "comments.write", "destructive", "write"],