@@ -116,17 +116,17 @@ The gem can be configured using the `ModelContextProtocol.configure` block:
116
116
117
117
``` ruby
118
118
ModelContextProtocol .configure do |config |
119
- config.exception_reporter = do | exception , server_context |
119
+ config.exception_reporter = -> ( exception, server_context) {
120
120
# Your exception reporting logic here
121
121
# For example with Bugsnag:
122
122
Bugsnag .notify(exception) do |report |
123
123
report.add_metadata(:model_context_protocol , server_context)
124
124
end
125
- end
125
+ }
126
126
127
- config.instrumentation_callback = do | data |
127
+ config.instrumentation_callback = -> ( data) {
128
128
puts " Got instrumentation data #{ data.inspect } "
129
- end
129
+ }
130
130
end
131
131
```
132
132
@@ -136,17 +136,17 @@ they might require different instrumentation callbacks.
136
136
137
137
``` ruby
138
138
configuration = ModelContextProtocol ::Configuration .new
139
- configuration.exception_reporter = do | exception , server_context |
139
+ configuration.exception_reporter = -> ( exception, server_context) {
140
140
# Your exception reporting logic here
141
141
# For example with Bugsnag:
142
142
Bugsnag .notify(exception) do |report |
143
143
report.add_metadata(:model_context_protocol , server_context)
144
144
end
145
- end
145
+ }
146
146
147
- configuration.instrumentation_callback = do | data |
147
+ configuration.instrumentation_callback = -> ( data) {
148
148
puts " Got instrumentation data #{ data.inspect } "
149
- end
149
+ }
150
150
151
151
server = ModelContextProtocol ::Server .new (
152
152
# ... all other options
@@ -208,9 +208,9 @@ instrumentation_callback = ->(data) { ... }
208
208
209
209
** Example:**
210
210
``` ruby
211
- config.instrumentation_callback = -> (data) do
211
+ config.instrumentation_callback = -> (data) {
212
212
puts " Instrumentation: #{ data.inspect } "
213
- end
213
+ }
214
214
```
215
215
216
216
### Server Protocol Version
@@ -418,10 +418,10 @@ To register a handler pass a proc/lambda to as `instrumentation_callback` into t
418
418
419
419
``` ruby
420
420
ModelContextProtocol .configure do |config |
421
- config.instrumentation_callback = do | data |
421
+ config.instrumentation_callback = -> ( data) {
422
422
puts " Got instrumentation data #{ data.inspect } "
423
423
end
424
- end
424
+ }
425
425
```
426
426
427
427
The data contains the following keys:
0 commit comments