feat:toolsbar add array support
This commit is contained in:
@@ -17,11 +17,6 @@ import ListPane from "./ListPane";
|
||||
|
||||
import { CompatibilityCallToolResult } from "@modelcontextprotocol/sdk/types.js";
|
||||
|
||||
type SchemaProperty = {
|
||||
type: string;
|
||||
description?: string;
|
||||
properties?: Record<string, SchemaProperty>;
|
||||
};
|
||||
|
||||
const ToolsTab = ({
|
||||
tools,
|
||||
@@ -168,7 +163,7 @@ const ToolsTab = ({
|
||||
</p>
|
||||
{Object.entries(selectedTool.inputSchema.properties ?? []).map(
|
||||
([key, value]) => {
|
||||
const prop = value as SchemaProperty;
|
||||
const prop = value as JsonSchemaType;
|
||||
return (
|
||||
<div key={key}>
|
||||
<Label
|
||||
@@ -211,15 +206,16 @@ const ToolsTab = ({
|
||||
}
|
||||
className="mt-1"
|
||||
/>
|
||||
) : prop.type === "object" ? (
|
||||
) : prop.type === "object"|| prop.type === "array" ? (
|
||||
<div className="mt-1">
|
||||
<DynamicJsonForm
|
||||
schema={
|
||||
{
|
||||
type: "object",
|
||||
type: prop.type,
|
||||
properties: prop.properties,
|
||||
description: prop.description,
|
||||
} as JsonSchemaType
|
||||
items:prop.items
|
||||
}
|
||||
}
|
||||
value={(params[key] as JsonValue) ?? {}}
|
||||
onChange={(newValue: JsonValue) => {
|
||||
|
||||
Reference in New Issue
Block a user