File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -460,9 +460,10 @@ The `MCP::Resource` class provides a way to register resources with the server.
460
460
461
461
``` ruby
462
462
resource = MCP ::Resource .new (
463
- uri: " example.com/my_resource" ,
464
- mime_type: " text/plain" ,
465
- text: " Lorem ipsum dolor sit amet"
463
+ uri: " https://example.com/my_resource" ,
464
+ name: " My Resource" ,
465
+ description: " Lorem ipsum dolor sit amet" ,
466
+ mime_type: " text/html" ,
466
467
)
467
468
468
469
server = MCP ::Server .new (
@@ -478,13 +479,13 @@ server.resources_read_handler do |params|
478
479
[{
479
480
uri: params[:uri ],
480
481
mimeType: " text/plain" ,
481
- text: " Hello, world! " ,
482
+ text: params[ :uri ] ,
482
483
}]
483
484
end
484
485
485
486
```
486
487
487
- otherwise ' resources/read' requests will be a no-op.
488
+ otherwise ` resources/read ` requests will be a no-op.
488
489
489
490
## Releases
490
491
You can’t perform that action at this time.
0 commit comments