Skip to content

Clarify resource read handler in README #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andyw8
Copy link
Contributor

@andyw8 andyw8 commented Jul 26, 2025

This better matches the code in /examples and helps illustrate the usage.

README.md Outdated
@@ -575,7 +575,7 @@ server.resources_read_handler do |params|
[{
uri: params[:uri],
mimeType: "text/plain",
text: params[:uri],
text: "Hello from example resource!"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As noted in #47, based on my experience, returning a simple string like "Hello" from resources/read was confusing when I first used resources/read. It would be helpful to have a more illustrative example...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated it have both the message and the URI, which hopefully is clearer.

@koic
Copy link
Member

koic commented Jul 27, 2025

Let's proceed with this. Can you squash your commits into one?

@andyw8 andyw8 force-pushed the andyw8/clarify-resource-read-handler-example-in-readme branch from edebe2d to ffb04e1 Compare July 27, 2025 15:31
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