Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions doit-mcp-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ import {
} from "../../src/tools/dimension.js";
import {
ListTicketsArgumentsSchema,
CreateTicketArgumentsSchema,
listTicketsTool,
createTicketTool,
} from "../../src/tools/tickets.js";
import {
ListInvoicesArgumentsSchema,
Expand Down Expand Up @@ -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);
Expand Down
34 changes: 0 additions & 34 deletions src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ import { prompts } from "./utils/prompts.js";
import {
listTicketsTool,
handleListTicketsRequest,
createTicketTool,
handleCreateTicketRequest,
} from "./tools/tickets.js";
import {
Expand Down Expand Up @@ -97,7 +96,6 @@ function createServer() {
dimensionsTool,
dimensionTool,
listTicketsTool,
createTicketTool,
listInvoicesTool,
getInvoiceTool,
listAllocationsTool,
Expand Down Expand Up @@ -188,7 +186,6 @@ export {
handleDimensionsRequest,
handleDimensionRequest,
handleListTicketsRequest,
handleCreateTicketRequest,
createErrorResponse,
formatZodError,
handleGeneralError,
Expand Down
3 changes: 0 additions & 3 deletions src/utils/toolsHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down