invalid.ts 391 B

1234567891011121314151617
  1. import z from "zod"
  2. import { Tool } from "./tool"
  3. export const InvalidTool = Tool.define("invalid", {
  4. description: "Do not use",
  5. parameters: z.object({
  6. tool: z.string(),
  7. error: z.string(),
  8. }),
  9. async execute(params) {
  10. return {
  11. title: "Invalid Tool",
  12. output: `The arguments provided to the tool are invalid: ${params.error}`,
  13. metadata: {},
  14. }
  15. },
  16. })