Compare commits

...

1 Commits

Author SHA1 Message Date
Kit Langton
835bc1cc52 refactor(tool): convert invalid tool internals to Effect 2026-04-09 22:45:08 -04:00

View File

@@ -1,17 +1,19 @@
import z from "zod"
import { Effect } from "effect"
import { Tool } from "./tool"
const parameters = z.object({
tool: z.string(),
error: z.string(),
})
export const InvalidTool = Tool.define("invalid", {
description: "Do not use",
parameters: z.object({
tool: z.string(),
error: z.string(),
}),
async execute(params) {
return {
parameters,
execute: (params: z.infer<typeof parameters>) =>
Effect.succeed({
title: "Invalid Tool",
output: `The arguments provided to the tool are invalid: ${params.error}`,
metadata: {},
}
},
}).pipe(Effect.runPromise),
})