(sigil mcp protocol)
(sigil mcp protocol) - JSON-RPC 2.0 protocol implementation for MCP.
Provides message parsing, generation, and error handling for the JSON-RPC 2.0 protocol used by MCP.
Exports
jsonrpc-requestprocedureConstruct a jsonrpc-request struct.
jsonrpc-request?procedureTest if a value is a jsonrpc-request struct.
jsonrpc-request-idprocedureGet the id field of a jsonrpc-request struct.
jsonrpc-request-methodprocedureGet the method field of a jsonrpc-request struct.
jsonrpc-request-paramsprocedureGet the params field of a jsonrpc-request struct.
jsonrpc-notificationprocedureConstruct a jsonrpc-notification struct.
jsonrpc-notification?procedureTest if a value is a jsonrpc-notification struct.
jsonrpc-notification-methodprocedureGet the method field of a jsonrpc-notification struct.
jsonrpc-notification-paramsprocedureGet the params field of a jsonrpc-notification struct.
jsonrpc-responseprocedureConstruct a jsonrpc-response struct.
jsonrpc-response?procedureTest if a value is a jsonrpc-response struct.
jsonrpc-response-idprocedureGet the id field of a jsonrpc-response struct.
jsonrpc-response-resultprocedureGet the result field of a jsonrpc-response struct.
jsonrpc-error-responseprocedureConstruct a jsonrpc-error-response struct.
jsonrpc-error-response?procedureTest if a value is a jsonrpc-error-response struct.
jsonrpc-error-response-idprocedureGet the id field of a jsonrpc-error-response struct.
jsonrpc-error-response-codeprocedureGet the code field of a jsonrpc-error-response struct.
jsonrpc-error-response-messageprocedureGet the message field of a jsonrpc-error-response struct.
jsonrpc-error-response-dataprocedureGet the data field of a jsonrpc-error-response struct.
parse-message-stringprocedureParse a JSON-RPC message from a JSON string.
Returns a jsonrpc-request, jsonrpc-notification, or #f on parse error. Does not handle batch requests (arrays).
parse-messageprocedureParse a JSON-RPC message from a parsed JSON value (dict).
Returns a jsonrpc-request, jsonrpc-notification, or #f if invalid.
response->jsonprocedureSerialize a successful response to JSON string.
error-response->jsonprocedureSerialize an error response to JSON string.
notification->jsonprocedureSerialize a notification to JSON string.
request->jsonprocedureSerialize a request to JSON string.
make-responseprocedureCreate a successful response for a request.
make-error-responseprocedureCreate an error response for a request.
make-notificationprocedureCreate a notification (server to client).