fix(mcp): map card.comment content field for Kan API (#540)
The MCP add_card_comment and update_card_comment tools send `{ content }`
to Kan API, but the API expects `{ comment }`. This causes a 400 Bad Request
("comment: Required") when trying to add or update card comments.
Fixed by mapping `{ comment: content }` in both tool handlers.
Co-authored-by: Craft Agent <agents-noreply@craft.do>
This commit is contained in:
@@ -119,7 +119,7 @@ export function registerCardTools(server: McpServer): void {
|
||||
content: z.string().describe("Comment text"),
|
||||
},
|
||||
async ({ cardPublicId, content }) => {
|
||||
const data = await kanRequest("POST", `/cards/${cardPublicId}/comments`, { content });
|
||||
const data = await kanRequest("POST", `/cards/${cardPublicId}/comments`, { comment: content });
|
||||
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
||||
},
|
||||
);
|
||||
@@ -136,7 +136,7 @@ export function registerCardTools(server: McpServer): void {
|
||||
const data = await kanRequest(
|
||||
"PUT",
|
||||
`/cards/${cardPublicId}/comments/${commentPublicId}`,
|
||||
{ content },
|
||||
{ comment: content },
|
||||
);
|
||||
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user