- {JSON.stringify(JSON.parse(request.request), null, 2)}
-
+
- {JSON.stringify(
- JSON.parse(request.response),
- null,
- 2,
- )}
-
+
- {JSON.stringify(notification, null, 2)}
-
+ "{value}"
+ setIsExpanded(!isExpanded)}
+ title={isExpanded ? "Click to collapse" : "Click to expand"}
+ >
+ {isExpanded ? `"${value}"` : `"${value.slice(0, maxLength)}..."`}
+
+
- {resourceContent}
-
+ diff --git a/client/src/components/SamplingTab.tsx b/client/src/components/SamplingTab.tsx index 5c45400..21fc7dd 100644 --- a/client/src/components/SamplingTab.tsx +++ b/client/src/components/SamplingTab.tsx @@ -5,6 +5,7 @@ import { CreateMessageRequest, CreateMessageResult, } from "@modelcontextprotocol/sdk/types.js"; +import JsonView from "./JsonView"; export type PendingRequest = { id: number; @@ -43,9 +44,9 @@ const SamplingTab = ({ pendingRequests, onApprove, onReject }: Props) => {
- {JSON.stringify(request.request, null, 2)}
-
+