-
Couldn't load subscription status.
- Fork 77
fix Prompt type gaps with 2025-06-18 spec
#153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
`PromptArgument extends BaseMetadata`, which includes both name and title - https://github.com/modelcontextprotocol/modelcontextprotocol/blob/51e093b8ebfde5e968879024566b7380d30c52d0/schema/2025-06-18/schema.ts#L686-L698 - https://github.com/modelcontextprotocol/modelcontextprotocol/blob/51e093b8ebfde5e968879024566b7380d30c52d0/schema/2025-06-18/schema.ts#L294-l309
| name: name_value, | ||
| title: title_value, | ||
| description: description_value, | ||
| arguments: arguments_value&.map(&:to_h), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that the tests passes even without safe navigation. Is it necessary?
| arguments: arguments_value&.map(&:to_h), | |
| arguments: arguments_value.map(&:to_h), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good callout - this is a possible state if a Prompt class doesn't define arguments.
I added a test to exercise and cover this behaviour.
ruby-sdk/test/mcp/prompt_test.rb
Lines 180 to 193 in a1dd3dd
| test "#to_h handles nil arguments value" do | |
| class NoArgumentsPrompt < Prompt | |
| description "No arguments prompt" | |
| end | |
| prompt = NoArgumentsPrompt | |
| expected = { | |
| name: "no_arguments_prompt", | |
| description: "No arguments prompt", | |
| } | |
| assert_equal expected, prompt.to_h | |
| end | |
| end |
390e6b8 to
8aab228
Compare
> See [General fields: `_meta`](/specification/2025-06-18/basic/index#meta) for notes on `_meta` usage. https://github.com/modelcontextprotocol/modelcontextprotocol/blob/51e093b8ebfde5e968879024566b7380d30c52d0/schema/2025-06-18/schema.ts#L680-L683
8aab228 to
a1dd3dd
Compare
|
Thanks! |
Motivation and Context
add
titlefield to prompt argument 701f6faPromptArgument extends BaseMetadata, which includes both name andtitle
add
_metafield toPrompt390e6b8https://github.com/modelcontextprotocol/modelcontextprotocol/blob/51e093b8ebfde5e968879024566b7380d30c52d0/schema/2025-06-18/schema.ts#L680-L683
How Has This Been Tested?
updated existing tests for prompt construction to include meta field and argument titles.
Breaking Changes
None
Types of changes
Checklist
Additional context
simplifying sharing
BaseMetadatabehaviour with a module mixin' coming in follow up PR - wip ; e2a8f27