Skip to content

Commit b5c775e

Browse files
authored
Merge pull request #61 from doitintl/patch/talc/remove-support-tool
feat(mcp): remove create ticket tool
2 parents 757cee4 + 4f0ac44 commit b5c775e

File tree

4 files changed

+0
-45
lines changed

4 files changed

+0
-45
lines changed

doit-mcp-server/src/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ import {
3939
} from "../../src/tools/dimension.js";
4040
import {
4141
ListTicketsArgumentsSchema,
42-
CreateTicketArgumentsSchema,
4342
listTicketsTool,
44-
createTicketTool,
4543
} from "../../src/tools/tickets.js";
4644
import {
4745
ListInvoicesArgumentsSchema,
@@ -254,9 +252,6 @@ export class DoitMCPAgent extends McpAgent {
254252

255253
// Tickets tools
256254
this.registerTool(listTicketsTool, ListTicketsArgumentsSchema);
257-
if (this.props.isDoitUser !== "true") {
258-
this.registerTool(createTicketTool, CreateTicketArgumentsSchema);
259-
}
260255

261256
// Invoices tools
262257
this.registerTool(listInvoicesTool, ListInvoicesArgumentsSchema);

src/__tests__/index.test.ts

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,7 @@ vi.mock("../tools/tickets.js", () => ({
5959
name: "list_tickets",
6060
description: "List support tickets from DoiT using the support API.",
6161
},
62-
createTicketTool: {
63-
name: "create_ticket",
64-
description: "Create a new support ticket in DoiT using the support API.",
65-
},
6662
handleListTicketsRequest: vi.fn(),
67-
handleCreateTicketRequest: vi.fn(),
6863
}));
6964
vi.mock("../tools/invoices.ts", () => ({
7065
listInvoicesTool: {
@@ -231,11 +226,6 @@ describe("ListToolsRequestSchema Handler", () => {
231226
name: "list_tickets",
232227
description: "List support tickets from DoiT using the support API.",
233228
},
234-
{
235-
name: "create_ticket",
236-
description:
237-
"Create a new support ticket in DoiT using the support API.",
238-
},
239229
{
240230
name: "list_invoices",
241231
description:
@@ -478,30 +468,6 @@ describe("CallToolRequestSchema Handler", () => {
478468
);
479469
});
480470

481-
it("should route to the correct tool handler for create_ticket", async () => {
482-
const callToolHandler = setRequestHandlerMock.mock.calls.find(
483-
(call) => call[0] === CallToolRequestSchema
484-
)?.[1];
485-
const args = {
486-
ticket: {
487-
body: "Help!",
488-
created: "2024-06-01T12:00:00Z",
489-
platform: "doit",
490-
product: "test-product",
491-
severity: "normal",
492-
subject: "Test ticket",
493-
},
494-
};
495-
const request = mockRequest("create_ticket", args);
496-
497-
await callToolHandler(request);
498-
499-
expect(indexModule.handleCreateTicketRequest).toHaveBeenCalledWith(
500-
args,
501-
"fake-token"
502-
);
503-
});
504-
505471
it("should route to the correct tool handler for list_invoices", async () => {
506472
const callToolHandler = setRequestHandlerMock.mock.calls.find(
507473
(call) => call[0] === CallToolRequestSchema

src/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ import { prompts } from "./utils/prompts.js";
4848
import {
4949
listTicketsTool,
5050
handleListTicketsRequest,
51-
createTicketTool,
5251
handleCreateTicketRequest,
5352
} from "./tools/tickets.js";
5453
import {
@@ -97,7 +96,6 @@ function createServer() {
9796
dimensionsTool,
9897
dimensionTool,
9998
listTicketsTool,
100-
createTicketTool,
10199
listInvoicesTool,
102100
getInvoiceTool,
103101
listAllocationsTool,
@@ -188,7 +186,6 @@ export {
188186
handleDimensionsRequest,
189187
handleDimensionRequest,
190188
handleListTicketsRequest,
191-
handleCreateTicketRequest,
192189
createErrorResponse,
193190
formatZodError,
194191
handleGeneralError,

src/utils/toolsHandler.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ export async function executeToolHandler(
8787
case "list_tickets":
8888
result = await handleListTicketsRequest(args, token);
8989
break;
90-
case "create_ticket":
91-
result = await handleCreateTicketRequest(args, token);
92-
break;
9390
case "list_invoices":
9491
result = await handleListInvoicesRequest(args, token);
9592
break;

0 commit comments

Comments
 (0)