Skip to content

Conversation

topherbullock
Copy link
Contributor

@topherbullock topherbullock commented Oct 6, 2025

Motivation and Context

add title field to prompt argument 701f6fa

PromptArgument extends BaseMetadata, which includes both name and
title

add _meta field to Prompt 390e6b8

See General fields: _meta for notes on _meta usage.

https://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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

simplifying sharing BaseMetadata behaviour with a module mixin' coming in follow up PR - wip ; e2a8f27

name: name_value,
title: title_value,
description: description_value,
arguments: arguments_value&.map(&:to_h),
Copy link
Member

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?

Suggested change
arguments: arguments_value&.map(&:to_h),
arguments: arguments_value.map(&:to_h),

Copy link
Contributor Author

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.

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

@topherbullock topherbullock force-pushed the prompt-spec-compliance branch from 390e6b8 to 8aab228 Compare October 10, 2025 12:53
@topherbullock topherbullock force-pushed the prompt-spec-compliance branch from 8aab228 to a1dd3dd Compare October 10, 2025 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants