Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

mcpToolPresentation.test.ts

23 lines646 Bytes

1import { describe, expect, it } from "@effect/vitest";
2import { mcpToolPresentation } from "./mcpToolPresentation.ts";
3​
4describe("mcpToolPresentation", () => {
5 it.each([
6 "javascript:alert(1)",
7 "file:///tmp/logo.png",
8 "not a URL",
9 "https://example.com/" + "x".repeat(4096),
10 ])("ignores an invalid logo %s", (iconUrl) => {
11 expect(
12 mcpToolPresentation({
13 serverName: "weather",
14 toolName: "get_weather",
15 iconUrl,
16 title: "x".repeat(161),
17 }),
18 ).toEqual({
19 title: "get weather",
20 toolSource: { key: "mcp:weather", name: "weather", kind: "integration" },
21 });
22 });
23});