@@ -373,7 +373,7 @@ This gem provides a `MCP::Tool` class that can be used to create tools in two wa
373
373
374
374
``` ruby
375
375
class MyTool < MCP ::Tool
376
- title " My Tool"
376
+ title " My Tool" # WARNING: This is a `Draft` and is not supported in the `Version 2025-06-18 (latest)` specification.
377
377
description " This tool performs specific functionality..."
378
378
input_schema(
379
379
properties: {
@@ -385,7 +385,8 @@ class MyTool < MCP::Tool
385
385
read_only_hint: true ,
386
386
destructive_hint: false ,
387
387
idempotent_hint: true ,
388
- open_world_hint: false
388
+ open_world_hint: false ,
389
+ title: " My Tool"
389
390
)
390
391
391
392
def self .call (message: , server_context: )
@@ -401,10 +402,11 @@ tool = MyTool
401
402
``` ruby
402
403
tool = MCP ::Tool .define(
403
404
name: " my_tool" ,
404
- title: " My Tool" ,
405
+ title: " My Tool" , # WARNING: This is a `Draft` and is not supported in the `Version 2025-06-18 (latest)` specification.
405
406
description: " This tool performs specific functionality..." ,
406
407
annotations: {
407
- read_only_hint: true
408
+ read_only_hint: true ,
409
+ title: " My Tool"
408
410
}
409
411
) do |args , server_context |
410
412
MCP ::Tool ::Response .new ([{ type: " text" , text: " OK" }])
@@ -418,11 +420,11 @@ e.g. around authentication state.
418
420
419
421
Tools can include annotations that provide additional metadata about their behavior. The following annotations are supported:
420
422
421
- - ` title ` : A human-readable title for the tool
422
- - ` read_only_hint ` : Indicates if the tool only reads data (doesn't modify state)
423
423
- ` destructive_hint ` : Indicates if the tool performs destructive operations
424
424
- ` idempotent_hint ` : Indicates if the tool's operations are idempotent
425
425
- ` open_world_hint ` : Indicates if the tool operates in an open world context
426
+ - ` read_only_hint ` : Indicates if the tool only reads data (doesn't modify state)
427
+ - ` title ` : A human-readable title for the tool
426
428
427
429
Annotations can be set either through the class definition using the ` annotations ` class method or when defining a tool using the ` define ` method.
428
430
@@ -437,7 +439,7 @@ The `MCP::Prompt` class provides two ways to create prompts:
437
439
``` ruby
438
440
class MyPrompt < MCP ::Prompt
439
441
prompt_name " my_prompt" # Optional - defaults to underscored class name
440
- title " My Prompt"
442
+ title " My Prompt" # WARNING: This is a `Draft` and is not supported in the `Version 2025-06-18 (latest)` specification.
441
443
description " This prompt performs specific functionality..."
442
444
arguments [
443
445
MCP ::Prompt ::Argument .new (
@@ -474,7 +476,7 @@ prompt = MyPrompt
474
476
``` ruby
475
477
prompt = MCP ::Prompt .define(
476
478
name: " my_prompt" ,
477
- title: " My Prompt" ,
479
+ title: " My Prompt" , # WARNING: This is a `Draft` and is not supported in the `Version 2025-06-18 (latest)` specification.
478
480
description: " This prompt performs specific functionality..." ,
479
481
arguments: [
480
482
MCP ::Prompt ::Argument .new (
@@ -561,7 +563,7 @@ The `MCP::Resource` class provides a way to register resources with the server.
561
563
resource = MCP ::Resource .new (
562
564
uri: " https://example.com/my_resource" ,
563
565
name: " my-resource" ,
564
- title: " My Resource" ,
566
+ title: " My Resource" , # WARNING: This is a `Draft` and is not supported in the `Version 2025-06-18 (latest)` specification.
565
567
description: " Lorem ipsum dolor sit amet" ,
566
568
mime_type: " text/html" ,
567
569
)
0 commit comments