Skip to main content
Glama

Update Comment

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
NameRequiredDescriptionDefault
contentNo
idYes

Implementation Reference

  • 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 });
    };
  • 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
    );
  • 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()
      }
    },
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It states the tool updates comment content, implying a mutation operation, but doesn't cover permissions required, side effects (e.g., whether it triggers notifications), error handling, or response format. This is a significant gap for a mutation tool with zero annotation coverage.

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

Conciseness5/5

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

The description is a single, direct sentence with zero wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place, though this conciseness comes at the cost of completeness.

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 a mutation tool with 2 parameters, 0% schema coverage, no annotations, and no output schema, the description is inadequate. It lacks details on parameters, behavioral traits, error cases, and output expectations. For this complexity level, it should provide more context to be complete enough for effective use.

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?

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It mentions 'content' as updatable, which aligns with one parameter, but doesn't explain the 'id' parameter (required) or provide any details on format, constraints, or examples. The description adds minimal value beyond the schema's property names.

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 ('Update') and resource ('comment content'), making the purpose understandable. It distinguishes from siblings like 'affine_create_comment' (creation) and 'affine_delete_comment' (deletion), though it doesn't explicitly contrast them. The description is specific but lacks detail about what aspects of a comment can be updated beyond 'content'.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing comment ID), exclusions, or compare it to related tools like 'affine_resolve_comment' or 'affine_create_comment'. Usage is implied only by the verb 'Update', with no contextual instructions.

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

Related 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