@utaba/ucm-mcp-server
Version:
Universal Context Manager MCP Server - AI Productivity Platform
68 lines • 2.93 kB
JavaScript
import { BaseToolController } from '../base/BaseToolController.js';
export class SubmitFeedbackTool extends BaseToolController {
constructor(ucmClient, logger, publishingAuthorId) {
super(ucmClient, logger, publishingAuthorId);
}
get name() {
return 'ucm_submit_user_issue_or_feedback';
}
get description() {
return 'Submit user feedback, bug reports, feature requests ONLY if the user requests it and they want to send details to the UCM development team. Do NOT include sensitive or project related details. Ask the user before submitting the data if it is appropriate.';
}
get inputSchema() {
return {
type: 'object',
properties: {
title: {
type: 'string',
description: 'Brief title for the feedback or issue (1-100 characters)',
minLength: 1,
maxLength: 100
},
body: {
type: 'string',
description: 'Detailed description of the feedback or issue (1-1000 characters)',
minLength: 1,
maxLength: 1000
},
reportType: {
type: 'string',
enum: ['issue', 'feedback'],
description: 'Type of report: "issue" for bug reports and problems, "feedback" for feature requests and general feedback'
},
tags: {
type: 'string',
description: 'Optional comma-separated tags for categorization (e.g., "ui,bug,performance")',
maxLength: 1000
}
},
required: ['title', 'body', 'reportType']
};
}
async handleExecute(params) {
this.logger.info('SubmitFeedbackTool', `Submitting ${params.reportType}: ${params.title}`);
try {
const result = await this.ucmClient.submitFeedback({
title: params.title,
body: params.body,
reportType: params.reportType,
tags: params.tags
});
this.logger.info('SubmitFeedbackTool', `Successfully submitted ${params.reportType} with ID: ${result.feedbackId}`);
return {
success: true,
feedbackId: result.feedbackId,
submittedAt: result.createdAt,
message: result.message,
reportType: params.reportType,
title: params.title
};
}
catch (error) {
const errorMessage = error instanceof Error ? error.message : String(error);
this.logger.error('SubmitFeedbackTool', `Failed to submit ${params.reportType}: ${errorMessage}`, '', error);
throw error;
}
}
}
//# sourceMappingURL=SubmitFeedbackTool.js.map