/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type MCPToolFilter = { readOnly?: boolean | undefined; toolNames?: Array | undefined; }; /** @internal */ export const MCPToolFilter$inboundSchema: z.ZodType< MCPToolFilter, z.ZodTypeDef, unknown > = z.object({ read_only: z.boolean().optional(), tool_names: z.array(z.string()).optional(), }).transform((v) => { return remap$(v, { "read_only": "readOnly", "tool_names": "toolNames", }); }); /** @internal */ export type MCPToolFilter$Outbound = { read_only?: boolean | undefined; tool_names?: Array | undefined; }; /** @internal */ export const MCPToolFilter$outboundSchema: z.ZodType< MCPToolFilter$Outbound, z.ZodTypeDef, MCPToolFilter > = z.object({ readOnly: z.boolean().optional(), toolNames: z.array(z.string()).optional(), }).transform((v) => { return remap$(v, { readOnly: "read_only", toolNames: "tool_names", }); }); export function mcpToolFilterToJSON(mcpToolFilter: MCPToolFilter): string { return JSON.stringify(MCPToolFilter$outboundSchema.parse(mcpToolFilter)); } export function mcpToolFilterFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => MCPToolFilter$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MCPToolFilter' from JSON`, ); }