/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { guardrailsTestGuardrails } from "../../funcs/guardrailsTestGuardrails.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.TestGuardrailsRequest$inboundSchema, }; export const tool$guardrailsTestGuardrails: ToolDefinition = { name: "guardrails-test-guardrails", description: `Test content against guardrails Test a piece of content against the caller's effective guardrails (org-wide policy plus team policy) without making an actual API call. Useful for debugging and validating guardrail configurations. Returns a report indicating whether the content passed and which guardrail was triggered if any.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await guardrailsTestGuardrails( client, args.request, { fetchOptions: { signal: ctx.signal } }, ).$inspect(); if (!result.ok) { return { content: [{ type: "text", text: result.error.message }], isError: true, }; } const value = result.value; return formatResult(value, apiCall); }, };