Skip to content

Commit 98646ab

Browse files
committed
Move MCP::Annotations to its own file
Also, implement `Annotations#to_h`
1 parent 8abae82 commit 98646ab

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

lib/mcp.rb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# frozen_string_literal: true
22

3+
require_relative "mcp/annotations"
34
require_relative "mcp/configuration"
45
require_relative "mcp/content"
56
require_relative "mcp/instrumentation"
@@ -32,13 +33,4 @@ def configuration
3233
@configuration ||= Configuration.new
3334
end
3435
end
35-
36-
class Annotations
37-
attr_reader :audience, :priority
38-
39-
def initialize(audience: nil, priority: nil)
40-
@audience = audience
41-
@priority = priority
42-
end
43-
end
4436
end

lib/mcp/annotations.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# frozen_string_literal: true
2+
3+
module MCP
4+
class Annotations
5+
attr_reader :audience, :priority
6+
7+
def initialize(audience: nil, priority: nil)
8+
@audience = audience
9+
@priority = priority
10+
11+
freeze
12+
end
13+
14+
def to_h
15+
{ audience:, priority: }.compact.freeze
16+
end
17+
end
18+
end

0 commit comments

Comments
 (0)