/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 4a2991ee68fe
 */

import * as z from "zod/v4";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";

/**
 * Capability for tools operations.
 */
export type ToolsCapability = {
  listChanged?: boolean | null | undefined;
  [additionalProperties: string]: unknown;
};

/** @internal */
export const ToolsCapability$inboundSchema: z.ZodType<
  ToolsCapability,
  unknown
> = z.object({
  listChanged: z.nullable(z.boolean()).optional(),
}).catchall(z.any());

export function toolsCapabilityFromJSON(
  jsonString: string,
): SafeParseResult<ToolsCapability, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => ToolsCapability$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'ToolsCapability' from JSON`,
  );
}
