Skip to content

Conversation

@koic
Copy link
Member

@koic koic commented Jun 6, 2025

Motivation and Context

MCP::Resource doesn't have text attribute:
https://github.com/modelcontextprotocol/ruby-sdk/blob/v0.1.0/lib/mcp/resource.rb#L8-L13

I've replaced it with attributes that it actually supports.

Also, the use of text: "Hello, world!" in the example of server.resources_read_handler implementation resulted in an unexpected response the first time I worked with Resource. While it may not be the best (but better), in my experience using Resources with Cline, text: params[:uri] served as a clearer response when interacting with an LLM, making it easier to understand.

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

@koic koic force-pushed the tweak_an_example_for_mcp_resource_in_readme branch 2 times, most recently from ee57318 to 1497907 Compare June 6, 2025 03:39
`MCP::Resource` doesn't have `text` attribute:
https://github.com/modelcontextprotocol/ruby-sdk/blob/v0.1.0/lib/mcp/resource.rb#L8-L13

I've replaced it with attributes that it actually supports.

Also, the use of `text: "Hello, world!"` in the example of `server.resources_read_handler` implementation resulted in
an unexpected response the first time I worked with `Resource`. While it may not be the best (but better),
in my experience using Resources with Cline, `text: params[:uri]` served as a clearer response when interacting with an LLM,
making it easier to understand.
@koic koic force-pushed the tweak_an_example_for_mcp_resource_in_readme branch from 1497907 to e9403c5 Compare June 6, 2025 04:36
@koic koic merged commit 04710ac into modelcontextprotocol:main Jun 9, 2025
5 checks passed
@koic koic deleted the tweak_an_example_for_mcp_resource_in_readme branch June 9, 2025 15:35
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