@studiosolid/shopware-mcp
Version:
A local Model Context Protocol (MCP) server for Shopware plugin development
42 lines (39 loc) • 1.65 kB
JavaScript
import { z } from 'zod';
import { getSupportTicket } from '../clients/shopwareAccount.client.js';
import formatSupportTicket from '../formatters/supportTicket.formatter.js';
export default {
name: 'get-support-ticket',
description: 'Get all available information about a support ticket',
paramsSchema: {
ticketId: z
.string()
.describe('The ticket id usually in the format ABCDE-123456. ABCDE being a short form of the plugin vendor name and 123456 being the ticket id.'),
},
cb: async (params) => {
try {
const ticket = await getSupportTicket(params.ticketId);
const formattedTicket = formatSupportTicket(ticket);
return {
content: [
{
type: 'text',
text: `Use the following information for support ticket ${params.ticketId} to create a summary of the issue.
Don't start trying to fix the bug yet. First you will need to ask for relevant information from the user to create a local environment. You must use the tool "ask-for-relevant-information" for this.
Here is the information about the support ticket:\n\n${formattedTicket}`,
},
],
};
}
catch (error) {
return {
content: [
{
type: 'text',
text: error instanceof Error ? error.message : 'An unknown error occurred',
},
],
isError: true,
};
}
},
};