Skip to content

fix(mcp): reduce anomalies count #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 27, 2025
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@doitintl/doit-mcp-server",
"version": "0.1.31",
"version": "0.1.32",
"description": "DoiT official MCP Server",
"keywords": [
"doit",
Expand Down
6 changes: 3 additions & 3 deletions src/tools/__tests__/anomalies.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ Top SKUs:
const response = await handleAnomaliesRequest(mockArgs, mockToken);

expect(makeDoitRequest).toHaveBeenCalledWith(
"https://api.doit.com/anomalies/v1?pageToken=next-page&maxResults=32",
"https://api.doit.com/anomalies/v1?pageToken=next-page&maxResults=20",
mockToken,
{
method: "GET",
Expand Down Expand Up @@ -172,7 +172,7 @@ Top SKUs:
const response = await handleAnomaliesRequest(mockArgs, mockToken);

expect(makeDoitRequest).toHaveBeenCalledWith(
"https://api.doit.com/anomalies/v1?maxResults=32",
"https://api.doit.com/anomalies/v1?maxResults=20",
mockToken,
{
method: "GET",
Expand All @@ -191,7 +191,7 @@ Top SKUs:
const response = await handleAnomaliesRequest(mockArgs, mockToken);

expect(makeDoitRequest).toHaveBeenCalledWith(
"https://api.doit.com/anomalies/v1?maxResults=32",
"https://api.doit.com/anomalies/v1?maxResults=20",
mockToken,
{ method: "GET" }
);
Expand Down
2 changes: 1 addition & 1 deletion src/tools/anomalies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export async function handleAnomaliesRequest(args: any, token: string) {
if (pageToken && pageToken.length > 1) {
params.append("pageToken", pageToken);
}
params.append("maxResults", "32");
params.append("maxResults", "20");

let anomaliesUrl = `${DOIT_API_BASE}/anomalies/v1`;

Expand Down
38 changes: 0 additions & 38 deletions src/tools/invoices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,6 @@ export const listInvoicesTool = {
},
},
},
outputSchema: z.object({
invoices: z.array(
z.object({
id: z.string(),
invoiceDate: z.number(),
platform: z.string(),
dueDate: z.number(),
status: z.string(),
totalAmount: z.number(),
balanceAmount: z.number(),
currency: z.string(),
url: z.string(),
})
),
pageToken: z.string().optional(),
rowCount: z.number(),
}),
};

// Handler for the tool
Expand Down Expand Up @@ -117,27 +100,6 @@ export const getInvoiceTool = {
},
required: ["id"],
},
outputSchema: z.object({
id: z.string(),
invoiceDate: z.number(),
platform: z.string(),
dueDate: z.number(),
status: z.string(),
totalAmount: z.number(),
balanceAmount: z.number(),
currency: z.string(),
url: z.string(),
lineItems: z.array(
z.object({
currency: z.string(),
description: z.string(),
details: z.string(),
price: z.number(),
qty: z.number(),
type: z.string(),
})
),
}),
};

// Handler for the tool
Expand Down
30 changes: 0 additions & 30 deletions src/tools/tickets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,6 @@ export const listTicketsTool = {
},
},
},
outputSchema: z.object({
pageToken: z.string().optional(),
rowCount: z.number(),
tickets: z.array(
z.object({
createTime: z.number(),
id: z.number(),
is_public: z.boolean(),
platform: z.string(),
product: z.string(),
requester: z.string(),
severity: z.string(),
status: z.string(),
subject: z.string(),
updateTime: z.number(),
urlUI: z.string(),
})
),
}),
};

// Handler for the tool
Expand Down Expand Up @@ -145,17 +126,6 @@ export const createTicketTool = {
},
required: ["ticket"],
},
outputSchema: z.object({
created: z.number(),
id: z.number(),
platform: z.string(),
product: z.string(),
requester: z.string(),
severity: z.string(),
status: z.string(),
subject: z.string(),
urlUI: z.string(),
}),
};

// Handler for creating a ticket
Expand Down