diff --git a/doit-mcp-server/src/index.ts b/doit-mcp-server/src/index.ts index 7558e16..67a8e01 100644 --- a/doit-mcp-server/src/index.ts +++ b/doit-mcp-server/src/index.ts @@ -39,9 +39,7 @@ import { } from "../../src/tools/dimension.js"; import { ListTicketsArgumentsSchema, - CreateTicketArgumentsSchema, listTicketsTool, - createTicketTool, } from "../../src/tools/tickets.js"; import { ListInvoicesArgumentsSchema, @@ -254,9 +252,6 @@ export class DoitMCPAgent extends McpAgent { // Tickets tools this.registerTool(listTicketsTool, ListTicketsArgumentsSchema); - if (this.props.isDoitUser !== "true") { - this.registerTool(createTicketTool, CreateTicketArgumentsSchema); - } // Invoices tools this.registerTool(listInvoicesTool, ListInvoicesArgumentsSchema); diff --git a/src/__tests__/index.test.ts b/src/__tests__/index.test.ts index 92f2f0d..4b8e8a2 100644 --- a/src/__tests__/index.test.ts +++ b/src/__tests__/index.test.ts @@ -59,12 +59,7 @@ vi.mock("../tools/tickets.js", () => ({ name: "list_tickets", description: "List support tickets from DoiT using the support API.", }, - createTicketTool: { - name: "create_ticket", - description: "Create a new support ticket in DoiT using the support API.", - }, handleListTicketsRequest: vi.fn(), - handleCreateTicketRequest: vi.fn(), })); vi.mock("../tools/invoices.ts", () => ({ listInvoicesTool: { @@ -231,11 +226,6 @@ describe("ListToolsRequestSchema Handler", () => { name: "list_tickets", description: "List support tickets from DoiT using the support API.", }, - { - name: "create_ticket", - description: - "Create a new support ticket in DoiT using the support API.", - }, { name: "list_invoices", description: @@ -478,30 +468,6 @@ describe("CallToolRequestSchema Handler", () => { ); }); - it("should route to the correct tool handler for create_ticket", async () => { - const callToolHandler = setRequestHandlerMock.mock.calls.find( - (call) => call[0] === CallToolRequestSchema - )?.[1]; - const args = { - ticket: { - body: "Help!", - created: "2024-06-01T12:00:00Z", - platform: "doit", - product: "test-product", - severity: "normal", - subject: "Test ticket", - }, - }; - const request = mockRequest("create_ticket", args); - - await callToolHandler(request); - - expect(indexModule.handleCreateTicketRequest).toHaveBeenCalledWith( - args, - "fake-token" - ); - }); - it("should route to the correct tool handler for list_invoices", async () => { const callToolHandler = setRequestHandlerMock.mock.calls.find( (call) => call[0] === CallToolRequestSchema diff --git a/src/index.ts b/src/index.ts index e4c0a5d..c0588b1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -48,7 +48,6 @@ import { prompts } from "./utils/prompts.js"; import { listTicketsTool, handleListTicketsRequest, - createTicketTool, handleCreateTicketRequest, } from "./tools/tickets.js"; import { @@ -97,7 +96,6 @@ function createServer() { dimensionsTool, dimensionTool, listTicketsTool, - createTicketTool, listInvoicesTool, getInvoiceTool, listAllocationsTool, @@ -188,7 +186,6 @@ export { handleDimensionsRequest, handleDimensionRequest, handleListTicketsRequest, - handleCreateTicketRequest, createErrorResponse, formatZodError, handleGeneralError, diff --git a/src/utils/toolsHandler.ts b/src/utils/toolsHandler.ts index eb9d997..fd25e6d 100644 --- a/src/utils/toolsHandler.ts +++ b/src/utils/toolsHandler.ts @@ -87,9 +87,6 @@ export async function executeToolHandler( case "list_tickets": result = await handleListTicketsRequest(args, token); break; - case "create_ticket": - result = await handleCreateTicketRequest(args, token); - break; case "list_invoices": result = await handleListInvoicesRequest(args, token); break;