+13
-2
bin/audio_example.ml
+13
-2
bin/audio_example.ml
·········
+13
-2
bin/capitalize_sdk.ml
+13
-2
bin/capitalize_sdk.ml
·········
+13
-2
bin/completion_example.ml
+13
-2
bin/completion_example.ml
·········
+24
-5
bin/dune
+24
-5
bin/dune
···
+468
bin/image_generator_example.ml
+468
bin/image_generator_example.ml
···+let b2 = if i * 3 + 1 < String.length bytes then Char.code (String.get bytes (i * 3 + 1)) else 0 in+let b3 = if i * 3 + 2 < String.length bytes then Char.code (String.get bytes (i * 3 + 2)) else 0 in+let result = Buffer.create (8 + Buffer.length ihdr_chunk + Buffer.length idat_chunk + Buffer.length iend_chunk) in+content = make_text_content (Printf.sprintf "Please describe what you see in this %dx%d pixel art."
+502
bin/multimodal_example.ml
+502
bin/multimodal_example.ml
···+let b2 = if i * 3 + 1 < String.length bytes then Char.code (String.get bytes (i * 3 + 1)) else 0 in+let b3 = if i * 3 + 2 < String.length bytes then Char.code (String.get bytes (i * 3 + 2)) else 0 in+let value = int_of_float (amplitude *. max_amplitude *. sin (2.0 *. Float.pi *. frequency *. t)) in+content = make_text_content "I've received your multimodal message with text, image, and audio."+content = make_text_resource_content (Printf.sprintf "resource://%s" resource_id) resource_content ~mime_type:"text/plain" ()+let server = configure_server server ~with_tools:true ~with_resources:false ~with_prompts:true () in
+13
-2
bin/resource_template_example.ml
+13
-2
bin/resource_template_example.ml
·········
+6
lib/dune
+6
lib/dune
+78
-7
lib/mcp_sdk.ml
+78
-7
lib/mcp_sdk.ml
···············
+18
-1
lib/mcp_sdk.mli
+18
-1
lib/mcp_sdk.mli
···val create : name:string -> ?description:string -> ?arguments:argument list -> handler:handler -> unit -> tval create_argument : name:string -> ?description:string -> ?required:bool -> unit -> argument···
+533
lib/mcp_server.ml
+533
lib/mcp_server.ml
···+Some (create_error ~id:req.id ~code:ErrorCode.invalid_params ~message:"Invalid params for tools/call" ())+Some (create_error ~id:req.id ~code:ErrorCode.method_not_found ~message:"Resources not supported" ())+Some (create_error ~id:req.id ~code:ErrorCode.method_not_found ~message:"Prompts not supported" ())+Some (create_error ~id:req.id ~code:ErrorCode.invalid_params ~message:(Printf.sprintf "Prompt not found: %s" name) ())+Some (create_error ~id:req.id ~code:ErrorCode.invalid_params ~message:"Invalid params format" ())+Some (create_error ~id:req.id ~code:ErrorCode.method_not_found ~message:"Prompts not supported" ())+Some (create_error ~id:req.id ~code:ErrorCode.method_not_found ~message:("Method not found: " ^ req.method_) ())+Log.error (Printf.sprintf "Exception during message processing: %s" (Printexc.to_string exc));+Log.debug (Printf.sprintf "Raw input: %s" (String.sub line 0 (min 100 (String.length line))));+Log.error (Printf.sprintf "Input was: %s" (String.sub line 0 (min 100 (String.length line))));+let error_resp = create_error ~id ~code:ErrorCode.internal_error ~message:(Printexc.to_string exc) () in
+54
lib/mcp_server.mli
+54
lib/mcp_server.mli
···