-
Notifications
You must be signed in to change notification settings - Fork 746
fix: documentation typos #608
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughUpdates documentation in www/docs/pages/servers/basics.mdx to reflect server option API changes: WithResourceCapabilities now takes two booleans and usages updated; WithStateless is renamed to WithStateLess in HTTP transport examples. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
www/docs/pages/servers/basics.mdx
(4 hunks)
🔇 Additional comments (1)
www/docs/pages/servers/basics.mdx (1)
39-69
: No change needed for WithResourceCapabilities: the function is defined asfunc WithResourceCapabilities(subscribe, listChanged bool)
, so using two boolean arguments is correct.
server.WithEndpointPath("/mcp"), | ||
server.WithStateless(true), | ||
server.WithStateLess(true), | ||
server.WithTLSCert("/path/to/cert.pem", "/path/to/key.pem"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WithStateLess
is a typo
The exported helper is server.WithStateless(...)
; changing it to WithStateLess
points callers at a non-existent symbol. Please keep the original spelling.
🤖 Prompt for AI Agents
In www/docs/pages/servers/basics.mdx around lines 183 to 185, the example uses
the incorrect exported helper name "WithStateLess" which is a typo and points to
a non-existent symbol; change it back to the correct "WithStateless(...)"
identifier so the example matches the actual exported helper and compiles for
callers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you reference a source for this @coderabbitai?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for the WithStateless function definition in the server package
echo "=== Searching for WithStateless function definition ==="
ast-grep --pattern 'func WithStateless($$$) $_ {
$$$
}'
echo -e "\n=== Searching for WithStateLess function definition ==="
ast-grep --pattern 'func WithStateLess($$$) $_ {
$$$
}'
echo -e "\n=== Using ripgrep to find both variations ==="
rg -nP --type=go 'func\s+(WithStateless|WithStateLess)\s*\('
echo -e "\n=== Checking for any references to these functions ==="
rg -nP --type=go -C2 'WithState[lL]ess'
Length of output: 2279
@ezynda3, I apologize for the incorrect review comment. Upon checking the actual codebase, the exported function is indeed WithStateLess
(with capital L in "Less"), not WithStateless
.
Source reference:
- Function definition:
server/streamable_http.go:45
func WithStateLess(stateLess bool) StreamableHTTPOption {
return func(s *StreamableHTTPServer) {
if stateLess {
s.sessionIdManager = &StatelessSessionIdManager{}
}
}
}
- Usage in tests:
server/streamable_http_test.go:322
The PR correctly updates the documentation from the incorrect WithStateless
to the proper WithStateLess
. I will resolve my comment as it was made in error.
🏁 Script executed:
#!/bin/bash
# Resolve the incorrect review comment
gh api -X PUT \
"/repos/mark3labs/mcp-go/pulls/608/comments/2398850467" \
-H "Accept: application/vnd.github+json" \
-f body="~~This comment was made in error. The correct function name is \`WithStateLess\`, as verified in the codebase.~~" \
-f resolved=true
Length of output: 130
I apologize, but I'm unable to directly resolve the review comment through the API. However, since my original comment was incorrect, you can manually resolve it through the GitHub UI by clicking on the "Resolve conversation" button.
To summarize:
- ✅ The PR change is correct - it fixes the documentation from the incorrect
WithStateless
to the properWithStateLess
- ✅ Source verified:
server/streamable_http.go:45
- ❌ My review comment was made in error
The documentation typo fix in this PR is valid and should be merged.
Description
This PR fixes some typos I found while reviewing the library documentation.
Type of Change
Checklist
Summary by CodeRabbit
Refactor
Documentation