package mcp-kit

All checked builds pass
  1. Overview
  2. Docs
OCaml library for building MCP servers

Install

dune-project
 Dependency

Authors

Maintainers

Sources

ocaml-mcp-v0.2.0.tar.gz
sha256=43c8319a13be91e323ae952a71ab673533fb3295886029eed9d81e5828de5ef7

doc/src/mcp-kit.jsonschema-validation/fmt_uuid.ml.html

Source file fmt_uuid.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
(** Format validator: uuid. *)

let is_hex = function
  | '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' -> true
  | _ -> false

let check_uuid s =
  let len = String.length s in
  if len <> 36 then false
  else
    let ok = ref true in
    for i = 0 to len - 1 do
      let c = s.[i] in
      let valid = match i with 8 | 13 | 18 | 23 -> c = '-' | _ -> is_hex c in
      if not valid then ok := false
    done;
    !ok