/* * 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 MCPTool = { name: string; inputSchema: { [k: string]: any }; annotations?: { [k: string]: any } | undefined; description?: string | undefined; }; /** @internal */ export const MCPTool$inboundSchema: z.ZodType = z.object({ name: z.string(), input_schema: z.record(z.any()), annotations: z.record(z.any()).optional(), description: z.string().optional(), }).transform((v) => { return remap$(v, { "input_schema": "inputSchema", }); }); /** @internal */ export type MCPTool$Outbound = { name: string; input_schema: { [k: string]: any }; annotations?: { [k: string]: any } | undefined; description?: string | undefined; }; /** @internal */ export const MCPTool$outboundSchema: z.ZodType< MCPTool$Outbound, z.ZodTypeDef, MCPTool > = z.object({ name: z.string(), inputSchema: z.record(z.any()), annotations: z.record(z.any()).optional(), description: z.string().optional(), }).transform((v) => { return remap$(v, { inputSchema: "input_schema", }); }); export function mcpToolToJSON(mcpTool: MCPTool): string { return JSON.stringify(MCPTool$outboundSchema.parse(mcpTool)); } export function mcpToolFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => MCPTool$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MCPTool' from JSON`, ); }