Skip to content

Commit aecfa21

Browse files
authored
fix: add static type validation
1 parent 2b79b6f commit aecfa21

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

client/src/components/ToolsTab.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
CallToolResult,
99
ListToolsResult,
1010
Tool,
11+
CallToolResultSchema,
1112
} from "@modelcontextprotocol/sdk/types.js";
1213
import { AlertCircle, Send } from "lucide-react";
1314
import { useState } from "react";
@@ -40,7 +41,7 @@ const ToolsTab = ({
4041
if (!toolResult) return null;
4142

4243
if ("content" in toolResult) {
43-
const structuredResult = toolResult as CallToolResult;
44+
const structuredResult = CallToolResultSchema.parse(toolResult);
4445
const isError = structuredResult.isError ?? false;
4546

4647
return (

0 commit comments

Comments
 (0)