Skip to content

Commit 2f354a8

Browse files
committed
Suppress redundant attributes in Resources
According to the specification, the following attributes are optional, so using `compact` ensures consistency. - `description`: Optional description - `mimeType`: Optional MIME type - `size`: Optional size in bytes https://modelcontextprotocol.io/specification/2025-03-26/server/resources#resource
1 parent 91219d3 commit 2f354a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/mcp/resource.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def to_h
1818
name: @name,
1919
description: @description,
2020
mimeType: @mime_type,
21-
}
21+
}.compact
2222
end
2323
end
2424
end

0 commit comments

Comments
 (0)