@@ -406,7 +406,7 @@ tool = MCP::Tool.define(
406
406
read_only_hint: true
407
407
}
408
408
) do |args , server_context |
409
- Tool ::Response .new ([{ type: " text" , text: " OK" }])
409
+ MCP :: Tool ::Response .new ([{ type: " text" , text: " OK" }])
410
410
end
411
411
```
412
412
@@ -438,7 +438,7 @@ class MyPrompt < MCP::Prompt
438
438
prompt_name " my_prompt" # Optional - defaults to underscored class name
439
439
description " This prompt performs specific functionality..."
440
440
arguments [
441
- Prompt ::Argument .new (
441
+ MCP :: Prompt ::Argument .new (
442
442
name: " message" ,
443
443
description: " Input message" ,
444
444
required: true
@@ -447,16 +447,16 @@ class MyPrompt < MCP::Prompt
447
447
448
448
class << self
449
449
def template (args , server_context: )
450
- Prompt ::Result .new (
450
+ MCP :: Prompt ::Result .new (
451
451
description: " Response description" ,
452
452
messages: [
453
- Prompt ::Message .new (
453
+ MCP :: Prompt ::Message .new (
454
454
role: " user" ,
455
- content: Content ::Text .new (" User message" )
455
+ content: MCP :: Content ::Text .new (" User message" )
456
456
),
457
- Prompt ::Message .new (
457
+ MCP :: Prompt ::Message .new (
458
458
role: " assistant" ,
459
- content: Content ::Text .new (args[" message" ])
459
+ content: MCP :: Content ::Text .new (args[" message" ])
460
460
)
461
461
]
462
462
)
@@ -474,23 +474,23 @@ prompt = MCP::Prompt.define(
474
474
name: " my_prompt" ,
475
475
description: " This prompt performs specific functionality..." ,
476
476
arguments: [
477
- Prompt ::Argument .new (
477
+ MCP :: Prompt ::Argument .new (
478
478
name: " message" ,
479
479
description: " Input message" ,
480
480
required: true
481
481
)
482
482
]
483
483
) do |args , server_context: |
484
- Prompt ::Result .new (
484
+ MCP :: Prompt ::Result .new (
485
485
description: " Response description" ,
486
486
messages: [
487
- Prompt ::Message .new (
487
+ MCP :: Prompt ::Message .new (
488
488
role: " user" ,
489
- content: Content ::Text .new (" User message" )
489
+ content: MCP :: Content ::Text .new (" User message" )
490
490
),
491
- Prompt ::Message .new (
491
+ MCP :: Prompt ::Message .new (
492
492
role: " assistant" ,
493
- content: Content ::Text .new (args[" message" ])
493
+ content: MCP :: Content ::Text .new (args[" message" ])
494
494
)
495
495
]
496
496
)
@@ -502,10 +502,10 @@ e.g. around authentication state or user preferences.
502
502
503
503
### Key Components
504
504
505
- - ` Prompt::Argument ` - Defines input parameters for the prompt template
506
- - ` Prompt::Message ` - Represents a message in the conversation with a role and content
507
- - ` Prompt::Result ` - The output of a prompt template containing description and messages
508
- - ` Content::Text ` - Text content for messages
505
+ - ` MCP:: Prompt::Argument` - Defines input parameters for the prompt template
506
+ - ` MCP:: Prompt::Message` - Represents a message in the conversation with a role and content
507
+ - ` MCP:: Prompt::Result` - The output of a prompt template containing description and messages
508
+ - ` MCP:: Content::Text` - Text content for messages
509
509
510
510
### Usage
511
511
0 commit comments