@@ -7,45 +7,13 @@ import { Textarea } from "@/components/ui/textarea";
7
7
import {
8
8
ListToolsResult ,
9
9
Tool ,
10
- TextContentSchema ,
11
- ImageContentSchema ,
12
- ResultSchema ,
13
- EmbeddedResourceSchema ,
10
+ CallToolResultSchema ,
14
11
} from "@modelcontextprotocol/sdk/types.js" ;
15
12
import { AlertCircle , Send } from "lucide-react" ;
16
13
import { useEffect , useState } from "react" ;
17
14
import ListPane from "./ListPane" ;
18
15
19
16
import { CompatibilityCallToolResult } from "@modelcontextprotocol/sdk/types.js" ;
20
- import { z } from "zod" ;
21
-
22
- // Define the AudioContent schema
23
- export const AudioContentSchema = z
24
- . object ( {
25
- type : z . literal ( "audio" ) ,
26
- data : z . string ( ) . base64 ( ) ,
27
- mimeType : z . string ( ) ,
28
- } )
29
- . passthrough ( ) ;
30
-
31
- // Extend the CallToolResult schema to include audio content
32
- export const ExtendedCallToolResultSchema = ResultSchema . extend ( {
33
- content : z . array (
34
- z . discriminatedUnion ( "type" , [
35
- TextContentSchema ,
36
- ImageContentSchema ,
37
- AudioContentSchema ,
38
- EmbeddedResourceSchema ,
39
- ] ) ,
40
- ) ,
41
- isError : z . boolean ( ) . default ( false ) . optional ( ) ,
42
- } ) ;
43
-
44
- // Export the types
45
- export type AudioContent = z . infer < typeof AudioContentSchema > ;
46
- export type ExtendedCallToolResult = z . infer <
47
- typeof ExtendedCallToolResultSchema
48
- > ;
49
17
50
18
const ToolsTab = ( {
51
19
tools,
@@ -77,7 +45,7 @@ const ToolsTab = ({
77
45
if ( ! toolResult ) return null ;
78
46
79
47
if ( "content" in toolResult ) {
80
- const parsedResult = ExtendedCallToolResultSchema . safeParse ( toolResult ) ;
48
+ const parsedResult = CallToolResultSchema . safeParse ( toolResult ) ;
81
49
if ( ! parsedResult . success ) {
82
50
return (
83
51
< >
@@ -119,15 +87,6 @@ const ToolsTab = ({
119
87
className = "max-w-full h-auto"
120
88
/>
121
89
) }
122
- { item . type === "audio" && (
123
- < audio
124
- controls
125
- src = { `data:${ item . mimeType } ;base64,${ item . data } ` }
126
- className = "w-full"
127
- >
128
- < p > Your browser does not support audio playback</ p >
129
- </ audio >
130
- ) }
131
90
{ item . type === "resource" &&
132
91
( item . resource ?. mimeType ?. startsWith ( "audio/" ) ? (
133
92
< audio
0 commit comments