The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { describe, expect, it } from "@effect/vitest"; |
| 2 | import { mcpToolPresentation } from "./mcpToolPresentation.ts"; |
| 3 | |
| 4 | describe("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 | }); |