Skip to content

Commit 09d66ab

Browse files
Merge pull request modelcontextprotocol#55 from modelcontextprotocol/justin/multiline-tool-inputs
Support multiline tool inputs
2 parents e4faa19 + f7385dd commit 09d66ab

File tree

1 file changed

+44
-19
lines changed

1 file changed

+44
-19
lines changed

client/src/components/ToolsTab.tsx

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ import { Button } from "@/components/ui/button";
33
import { Input } from "@/components/ui/input";
44
import { Label } from "@/components/ui/label";
55
import { TabsContent } from "@/components/ui/tabs";
6-
import { CallToolResult, ListToolsResult, Tool } from "@modelcontextprotocol/sdk/types.js";
6+
import { Textarea } from "@/components/ui/textarea";
7+
import {
8+
CallToolResult,
9+
ListToolsResult,
10+
Tool,
11+
} from "@modelcontextprotocol/sdk/types.js";
712
import { AlertCircle, Send } from "lucide-react";
813
import { useState } from "react";
914
import ListPane from "./ListPane";
@@ -123,24 +128,44 @@ const ToolsTab = ({
123128
>
124129
{key}
125130
</Label>
126-
<Input
127-
// @ts-expect-error value type is currently unknown
128-
type={value.type === "number" ? "number" : "text"}
129-
id={key}
130-
name={key}
131-
// @ts-expect-error value type is currently unknown
132-
placeholder={value.description}
133-
onChange={(e) =>
134-
setParams({
135-
...params,
136-
[key]:
137-
// @ts-expect-error value type is currently unknown
138-
value.type === "number"
139-
? Number(e.target.value)
140-
: e.target.value,
141-
})
142-
}
143-
/>
131+
{
132+
/* @ts-expect-error value type is currently unknown */
133+
value.type === "string" ? (
134+
<Textarea
135+
id={key}
136+
name={key}
137+
// @ts-expect-error value type is currently unknown
138+
placeholder={value.description}
139+
onChange={(e) =>
140+
setParams({
141+
...params,
142+
[key]: e.target.value,
143+
})
144+
}
145+
className="mt-1"
146+
/>
147+
) : (
148+
<Input
149+
// @ts-expect-error value type is currently unknown
150+
type={value.type === "number" ? "number" : "text"}
151+
id={key}
152+
name={key}
153+
// @ts-expect-error value type is currently unknown
154+
placeholder={value.description}
155+
onChange={(e) =>
156+
setParams({
157+
...params,
158+
[key]:
159+
// @ts-expect-error value type is currently unknown
160+
value.type === "number"
161+
? Number(e.target.value)
162+
: e.target.value,
163+
})
164+
}
165+
className="mt-1"
166+
/>
167+
)
168+
}
144169
</div>
145170
),
146171
)}

0 commit comments

Comments
 (0)