feat: update version to 1.1.0 and add new tools for blog, API keys, and sessions
CI / Build & Test (push) Successful in 36s
CI / Build & Test (push) Successful in 36s
This commit is contained in:
@@ -43,4 +43,44 @@ export function registerCommentTools(server: McpServer, client: BetterNewsClient
|
||||
return JSON.stringify(data, null, 2);
|
||||
}),
|
||||
);
|
||||
|
||||
server.tool(
|
||||
"like_comment",
|
||||
"Toggle a like on a comment. Requires news:comment scope.",
|
||||
{
|
||||
newsItemId: z.string().uuid().describe("News item UUID"),
|
||||
commentId: z.string().uuid().describe("Comment UUID"),
|
||||
},
|
||||
handleTool(async ({ newsItemId, commentId }) => {
|
||||
const data = await client.post<unknown>(`/api/news/${newsItemId}/comments/${commentId}/like`);
|
||||
return JSON.stringify(data, null, 2);
|
||||
}),
|
||||
);
|
||||
|
||||
server.tool(
|
||||
"dislike_comment",
|
||||
"Toggle a dislike on a comment. Requires news:comment scope.",
|
||||
{
|
||||
newsItemId: z.string().uuid().describe("News item UUID"),
|
||||
commentId: z.string().uuid().describe("Comment UUID"),
|
||||
},
|
||||
handleTool(async ({ newsItemId, commentId }) => {
|
||||
const data = await client.post<unknown>(`/api/news/${newsItemId}/comments/${commentId}/dislike`);
|
||||
return JSON.stringify(data, null, 2);
|
||||
}),
|
||||
);
|
||||
|
||||
server.tool(
|
||||
"hide_comment",
|
||||
"Hide or unhide a comment. Hidden comments are invisible to regular users but still visible to Mod/Admin. Requires Mod/Admin role and news:moderate scope.",
|
||||
{
|
||||
newsItemId: z.string().uuid().describe("News item UUID"),
|
||||
commentId: z.string().uuid().describe("Comment UUID"),
|
||||
hidden: z.boolean().describe("True to hide, false to unhide"),
|
||||
},
|
||||
handleTool(async ({ newsItemId, commentId, hidden }) => {
|
||||
const data = await client.patch<unknown>(`/api/news/${newsItemId}/comments/${commentId}`, { hidden });
|
||||
return JSON.stringify(data, null, 2);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user