Skip to main content
Glama

Delete Comment

delete_comment

Delete a comment from an AFFiNE workspace by providing its unique identifier.

Instructions

Delete a comment by id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • 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,
      });
    };
  • 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
    );
  • 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
    );
  • 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,
      });
    }
  • Tool group classification: delete_comment is categorized under comments, comments.write, destructive, write.
    delete_comment: ["comments", "comments.write", "destructive", "write"],
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description must cover behavioral traits. It states 'Delete' but does not disclose permanence, cascading effects, or required permissions. This lack of detail could lead to misuse.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at 5 words, which is appropriate for a simple delete-by-id operation. It front-loads the action and resource without unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 1 parameter and no output schema, the description omits important context: return value (e.g., success/error), side effects, and typical usage flow. A delete tool often benefits from clarifying if the operation is idempotent or reversible.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description should explain the 'id' parameter. It merely says 'by id', adding minimal meaning beyond the schema's type string. The format, source, or validation of the id is not clarified.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action 'Delete' and the resource 'a comment by id'. It is specific and distinguishes from sibling tools like update_comment or list_comments, though it does not elaborate on scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives (e.g., resolve_comment or update_comment). No prerequisites (e.g., permissions, ownership) are mentioned, leaving the agent to infer context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/DAWNCR0W/affine-mcp-server'

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