Skip to content

Commit eee8525

Browse files
committed
fix(tools): show error in inputs
1 parent 8c75fa2 commit eee8525

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/lib/server/tools/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const toolInputSchema = toolInputBaseSchema.and(
6161
z.object({ type: IOType }).or(
6262
z.object({
6363
type: z.literal("file"),
64-
mimeTypes: z.string().nonempty(),
64+
mimeTypes: z.string().min(1),
6565
})
6666
)
6767
);

src/routes/tools/ToolEdit.svelte

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,10 @@
367367
</p>
368368
</div>
369369

370+
<p class="text-xs text-red-500">
371+
{getError(`inputs`, form)}
372+
</p>
373+
370374
{#each editableTool.inputs as input, inputIdx}
371375
{@const parameter = endpoint.parameters.find(
372376
(parameter) => parameter.parameter_name === input.name
@@ -435,9 +439,6 @@
435439
bind:value={input.description}
436440
disabled={readonly}
437441
/>
438-
<p class="text-xs text-red-500">
439-
{getError(`${input.name}-description`, form)}
440-
</p>
441442
</label>
442443
{/if}
443444
{#if input.paramType === "optional" || input.paramType === "fixed"}
@@ -467,9 +468,6 @@
467468
bind:value={input.value}
468469
/>
469470
{/if}
470-
<p class="text-xs text-red-500">
471-
{getError(`${input.name}-${isOptional ? "default" : "value"}`, form)}
472-
</p>
473471
</div>
474472
{/if}
475473
{#if input.type === "file"}

0 commit comments

Comments
 (0)