remove min/max in tool schemas

This commit is contained in:
Dax Raad
2025-07-29 17:39:31 -04:00
parent 4a46144419
commit 7e9ac35666
4 changed files with 3 additions and 12 deletions

View File

@@ -1,14 +1,10 @@
import { Server } from "../../server/server"
import fs from "fs/promises"
import type { CommandModule } from "yargs"
export const GenerateCommand = {
command: "generate",
handler: async () => {
const specs = await Server.openapi()
const dir = "gen"
await fs.rmdir(dir, { recursive: true }).catch(() => {})
await fs.mkdir(dir, { recursive: true })
process.stdout.write(JSON.stringify(specs, null, 2))
},
} satisfies CommandModule

View File

@@ -11,7 +11,7 @@ export const BashTool = Tool.define("bash", {
description: DESCRIPTION,
parameters: z.object({
command: z.string().describe("The command to execute"),
timeout: z.number().min(0).max(MAX_TIMEOUT).describe("Optional timeout in milliseconds").optional(),
timeout: z.number().describe("Optional timeout in milliseconds").optional(),
description: z
.string()
.describe(

View File

@@ -4,7 +4,7 @@ import DESCRIPTION_WRITE from "./todowrite.txt"
import { App } from "../app/app"
const TodoInfo = z.object({
content: z.string().min(1).describe("Brief description of the task"),
content: z.string().describe("Brief description of the task"),
status: z.enum(["pending", "in_progress", "completed", "cancelled"]).describe("Current status of the task"),
priority: z.enum(["high", "medium", "low"]).describe("Priority level of the task"),
id: z.string().describe("Unique identifier for the todo item"),

View File

@@ -14,12 +14,7 @@ export const WebFetchTool = Tool.define("webfetch", {
format: z
.enum(["text", "markdown", "html"])
.describe("The format to return the content in (text, markdown, or html)"),
timeout: z
.number()
.min(0)
.max(MAX_TIMEOUT / 1000)
.describe("Optional timeout in seconds (max 120)")
.optional(),
timeout: z.number().describe("Optional timeout in seconds (max 120)").optional(),
}),
async execute(params, ctx) {
// Validate URL