Support icons parameter
This PR adds support for the optional `icons` parameter in prompt, resource, resource template, and server info. The specifications for `icons` are as follows. https://modelcontextprotocol.io/specification/2025-11-25/schema#icon Resolves https://github.com/modelcontextprotocol/ruby-sdk/issues/127.
This commit is contained in:
parent
d745ccdedc
commit
028c5f3291
1 changed files with 139 additions and 15 deletions
|
|
@ -2,13 +2,14 @@
|
|||
|
||||
module MCP
|
||||
class ResourceTemplate
|
||||
attr_reader :uri_template, :name, :title, :description, :mime_type
|
||||
attr_reader :uri_template, :name, :title, :description, :icons, :mime_type
|
||||
|
||||
def initialize(uri_template:, name:, title: nil, description: nil, mime_type: nil)
|
||||
def initialize(uri_template:, name:, title: nil, description: nil, icons: [], mime_type: nil)
|
||||
@uri_template = uri_template
|
||||
@name = name
|
||||
@title = title
|
||||
@description = description
|
||||
@icons = icons
|
||||
@mime_type = mime_type
|
||||
end
|
||||
|
||||
|
|
@ -18,6 +19,7 @@ module MCP
|
|||
name: name,
|
||||
title: title,
|
||||
description: description,
|
||||
icons: icons.map(&:to_h),
|
||||
mimeType: mime_type,
|
||||
}.compact
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue