bottlenecks-mcp-server
Version:
Model Context Protocol server for Bottlenecks database - enables AI agents like Claude to interact with bottleneck data
106 lines • 4.09 kB
JavaScript
/**
* MCP Feedback Operations Tools
* Lets AI agents file bug reports / feature requests as GitHub issues
*/
/**
* Submit a bug report or feature request
*/
export function createSubmitBugReportTool(client) {
return {
type: 'call_tool',
name: 'submit_bug_report',
description: 'File a bug report or feature request as a GitHub issue on the Bottlenecks repository. Requires a write-scoped API key.',
inputSchema: {
type: 'object',
properties: {
title: {
type: 'string',
description: 'Short, descriptive issue title',
minLength: 5,
maxLength: 200,
},
description: {
type: 'string',
description: 'Full description of the problem or request - what happened, what you expected, and any relevant context or steps to reproduce',
minLength: 20,
},
category: {
type: 'string',
description: 'Type of report',
enum: ['bug', 'feature', 'ui', 'performance'],
default: 'bug',
},
severity: {
type: 'string',
description: 'How urgent/impactful this is',
enum: ['critical', 'high', 'medium', 'low'],
default: 'medium',
},
page_url: {
type: 'string',
description: 'The page or API endpoint this relates to, if applicable',
},
},
required: ['title', 'description'],
},
handler: async (args) => {
try {
const hasWritePermission = await client.checkPermissions(['write']);
if (!hasWritePermission) {
return {
content: [
{
type: 'text',
text: 'Error: Write permission required to submit bug reports. Please check your API key scopes.',
},
],
isError: true,
};
}
const response = await client.request('/api/mcp/submit-bug-report', {
method: 'POST',
body: {
title: args.title,
description: args.description,
category: args.category || 'bug',
severity: args.severity || 'medium',
pageUrl: args.page_url,
},
requireAuth: true,
});
if (!response.success) {
return {
content: [
{
type: 'text',
text: `Error submitting bug report: ${response.error}`,
},
],
isError: true,
};
}
const { issueNumber, issueUrl } = response.data;
return {
content: [
{
type: 'text',
text: `
},
],
};
}
catch (error) {
return {
content: [
{
type: 'text',
text: `Error in submit_bug_report: ${error instanceof Error ? error.message : 'Unknown error'}`,
},
],
isError: true,
};
}
},
};
}
//# sourceMappingURL=feedback-operations.js.map