add_comment
Add comments or replies to Outline wiki documents to facilitate discussion and collaboration on content.
Instructions
Add a comment to a document. Supports replies.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| documentId | Yes | ||
| text | Yes | ||
| parentCommentId | No |
Implementation Reference
- src/lib/handlers/comments.ts:23-42 (handler)The main handler function for the 'add_comment' tool, which creates a comment on a document via the Outline API.async add_comment(args: AddCommentInput) { checkAccess(config, 'add_comment'); const payload: Record<string, unknown> = { documentId: args.documentId, data: { text: args.text }, }; if (args.parentCommentId) payload.parentCommentId = args.parentCommentId; const { data } = await apiCall(() => apiClient.post<OutlineComment>('/comments.create', payload) ); return { id: data.id, documentId: data.documentId, createdAt: data.createdAt, createdBy: data.createdBy?.name, message: MESSAGES.COMMENT_ADDED, }; },
- src/lib/schemas.ts:75-79 (schema)Zod schema definition for 'add_comment' input parameters: documentId, text, and optional parentCommentId.export const addCommentSchema = z.object({ documentId, text: z.string().min(1, 'Comment text is required'), parentCommentId: z.string().uuid().optional(), });
- src/lib/tools.ts:124-128 (registration)Registration of the 'add_comment' tool in the allTools array, linking name, description, and schema.createTool( 'add_comment', 'Add a comment to a document. Supports replies.', 'add_comment' ),
- src/lib/handlers/index.ts:19-28 (registration)Aggregates all handlers, including comment handlers containing 'add_comment', into the main ToolHandlers object.export function createAllHandlers(ctx: AppContext): ToolHandlers { return { ...createSearchHandlers(ctx), ...createDocumentHandlers(ctx), ...createCollectionHandlers(ctx), ...createCommentHandlers(ctx), ...createBatchHandlers(ctx), ...createSmartHandlers(ctx), } as ToolHandlers; }
- src/lib/schemas.ts:229-229 (schema)Mapping of 'add_comment' to its schema in the toolSchemas record.add_comment: addCommentSchema,