- add support for resource templates - improve capability negotiation on handlers - clean up readme - reduce default protocol version to "2024-11-05" - address spec compliance of resources - add debug gem to development - alias ModelContextProtocol to MCP - move prompt subclasses to subdir - improve tool and prompt definition - improve passing of server context to tools - improve tool input schema validation
24 lines
464 B
Ruby
24 lines
464 B
Ruby
# typed: strict
|
|
# frozen_string_literal: true
|
|
|
|
module ModelContextProtocol
|
|
class Resource
|
|
attr_reader :uri, :name, :description, :mime_type
|
|
|
|
def initialize(uri:, name:, description:, mime_type:)
|
|
@uri = uri
|
|
@name = name
|
|
@description = description
|
|
@mime_type = mime_type
|
|
end
|
|
|
|
def to_h
|
|
{
|
|
uri: @uri,
|
|
name: @name,
|
|
description: @description,
|
|
mimeType: @mime_type,
|
|
}
|
|
end
|
|
end
|
|
end
|