Redmine MCP serverを実装する
type ToolResponse = {
content: { type: string, content: string }[]
isError: boolean
};
show_issue: async (args: Record<string, unknown>): Promise<ToolResponse> => {
try {
const id = asNumber(args.id);
// チケットコメント(journals)を含める
const { issue } = await client.issues.getIssue(id, { include: "journals" });
return {
content: [{ type: "text", text: formatIssue(issue) }],
isError: false,
};
} catch (error) {
return {
content: [{ type: "text", text: error instanceof Error ? error.message : String(error) }],
isError: true,
};
}
},