accept_answer
Mark a comment as the accepted solution to resolve a question thread in Ed Discussion.
Instructions
Accept a comment as the answer to a question thread
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"thread_id": "<thread_id>",
"comment_id": "<comment_id>"
},
"name": "accept_answer"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| thread_id | Yes | Global thread ID | |
| comment_id | Yes | Comment ID to accept |
Implementation Reference
- src/api.ts:250-252 (handler)The actual API implementation for accepting an answer.
async acceptAnswer(threadId: number, commentId: number): Promise<void> { await this.request("POST", `threads/${threadId}/accept/${commentId}`); } - src/index.ts:390-404 (registration)Tool registration and handler invocation for 'accept_answer'.
server.tool( "accept_answer", "Accept a comment as the answer to a question thread", { thread_id: z.number().describe("Global thread ID"), comment_id: z.number().describe("Comment ID to accept"), }, async ({ thread_id, comment_id }) => { try { await api.acceptAnswer(thread_id, comment_id); return msg(`Comment ${comment_id} accepted as answer for thread ${thread_id}.`); } catch (err) { return fail(err); } }