docs(mcp): clarify price filters are dollars
This commit is contained in:
@@ -50,11 +50,11 @@ export const tools = [
|
||||
},
|
||||
priceMin: {
|
||||
type: "number",
|
||||
description: "Minimum price in cents",
|
||||
description: "Minimum price in dollars",
|
||||
},
|
||||
priceMax: {
|
||||
type: "number",
|
||||
description: "Maximum price in cents",
|
||||
description: "Maximum price in dollars",
|
||||
},
|
||||
unstableFilter: {
|
||||
type: "boolean",
|
||||
@@ -107,11 +107,11 @@ export const tools = [
|
||||
},
|
||||
minPrice: {
|
||||
type: "number",
|
||||
description: "Minimum price filter",
|
||||
description: "Minimum price in dollars",
|
||||
},
|
||||
maxPrice: {
|
||||
type: "number",
|
||||
description: "Maximum price filter",
|
||||
description: "Maximum price in dollars",
|
||||
},
|
||||
strictMode: {
|
||||
type: "boolean",
|
||||
|
||||
@@ -128,6 +128,46 @@ describe("MCP protocol unstableFilter", () => {
|
||||
expect(String(calledUrl)).toContain("unstableFilter=true");
|
||||
});
|
||||
|
||||
test("search_kijiji should document price filters as dollars", () => {
|
||||
const tool = tools.find((candidate) => candidate.name === "search_kijiji");
|
||||
|
||||
const priceMin = tool?.inputSchema.properties.priceMin as {
|
||||
description: string;
|
||||
};
|
||||
const priceMax = tool?.inputSchema.properties.priceMax as {
|
||||
description: string;
|
||||
};
|
||||
|
||||
expect(priceMin.description).toContain("dollars");
|
||||
expect(priceMax.description).toContain("dollars");
|
||||
});
|
||||
|
||||
test("handler should forward Kijiji dollar price filters to API", async () => {
|
||||
await handleMcpRequest(
|
||||
new Request("http://localhost", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
jsonrpc: "2.0",
|
||||
id: 1,
|
||||
method: "tools/call",
|
||||
params: {
|
||||
name: "search_kijiji",
|
||||
arguments: {
|
||||
query: "macbook",
|
||||
priceMin: 999.99,
|
||||
priceMax: 1000,
|
||||
},
|
||||
},
|
||||
}),
|
||||
}),
|
||||
);
|
||||
|
||||
const calledUrl = (global.fetch as unknown as ReturnType<typeof mock>).mock
|
||||
.calls[0]?.[0];
|
||||
expect(String(calledUrl)).toContain("priceMin=999.99");
|
||||
expect(String(calledUrl)).toContain("priceMax=1000");
|
||||
});
|
||||
|
||||
test("handler should forward unstableFilter=true for search_facebook", async () => {
|
||||
await handleMcpRequest(
|
||||
new Request("http://localhost", {
|
||||
@@ -204,4 +244,44 @@ describe("MCP protocol unstableFilter", () => {
|
||||
.calls[0]?.[0];
|
||||
expect(String(calledUrl)).toContain("unstableFilter=true");
|
||||
});
|
||||
|
||||
test("search_ebay should document price filters as dollars", () => {
|
||||
const tool = tools.find((candidate) => candidate.name === "search_ebay");
|
||||
|
||||
const minPrice = tool?.inputSchema.properties.minPrice as {
|
||||
description: string;
|
||||
};
|
||||
const maxPrice = tool?.inputSchema.properties.maxPrice as {
|
||||
description: string;
|
||||
};
|
||||
|
||||
expect(minPrice.description).toContain("dollars");
|
||||
expect(maxPrice.description).toContain("dollars");
|
||||
});
|
||||
|
||||
test("handler should forward eBay dollar price filters to API", async () => {
|
||||
await handleMcpRequest(
|
||||
new Request("http://localhost", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
jsonrpc: "2.0",
|
||||
id: 1,
|
||||
method: "tools/call",
|
||||
params: {
|
||||
name: "search_ebay",
|
||||
arguments: {
|
||||
query: "macbook",
|
||||
minPrice: 999.99,
|
||||
maxPrice: 1000,
|
||||
},
|
||||
},
|
||||
}),
|
||||
}),
|
||||
);
|
||||
|
||||
const calledUrl = (global.fetch as unknown as ReturnType<typeof mock>).mock
|
||||
.calls[0]?.[0];
|
||||
expect(String(calledUrl)).toContain("minPrice=999.99");
|
||||
expect(String(calledUrl)).toContain("maxPrice=1000");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user