René's URL Explorer Experiment


Title: Un-deprecate/add no-arg builders · Issue #1065 · modelcontextprotocol/java-sdk · GitHub

Open Graph Title: Un-deprecate/add no-arg builders · Issue #1065 · modelcontextprotocol/java-sdk

X Title: Un-deprecate/add no-arg builders · Issue #1065 · modelcontextprotocol/java-sdk

Description: #928 deprecated no-arg builders for schema types, e.g. McpSchema.Resource I'd like you to consider reversing that decision, and also to add no-arg versions for types without them (e.g. ProgressNotification). I understand the motivation t...

Open Graph Description: #928 deprecated no-arg builders for schema types, e.g. McpSchema.Resource I'd like you to consider reversing that decision, and also to add no-arg versions for types without them (e.g. ProgressNoti...

X Description: #928 deprecated no-arg builders for schema types, e.g. McpSchema.Resource I'd like you to consider reversing that decision, and also to add no-arg versions for types without them (e.g. Progress...

Opengraph URL: https://github.com/modelcontextprotocol/java-sdk/issues/1065

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Un-deprecate/add no-arg builders","articleBody":"#928 deprecated no-arg builders for schema types, e.g. McpSchema.Resource\n\nI'd like you to consider reversing that decision, and also to add no-arg versions for types without them (e.g. ProgressNotification).\n\nI understand the motivation that builders not be left in an invalid state. It's worth noting that it might achieve that aim currently (I didn't audit all the classes), but if the schema ever has any fields which are mutually exclusive or conditionally required, then using constructors will only offer partial protection.\n\nThe problem is that it makes it undermines one of the main advantages of the builder pattern, which is to make construction clearer.\n\nHere was my attempt to write a CreateMessageRequest with only required properties:\n\n```java\nvar request = McpSchema.CreateMessageRequest.builder(\n        List.of(McpSchema.SamplingMessage.builder(\n            McpSchema.Role.USER,\n            McpSchema.TextContent.builder(\"Test Sampling Message\").build()).build()\n        ),\n        50\n    )\n    .build();\n```\n\nMaybe there's a better way to format/indent this, but I tried several variations and I thought this was the best one. \n\nCompare that with the same thing constructed with named properties\n\n```java\nvar request = McpSchema.CreateMessageRequest.builder()\n    .messages(List.of(\n        McpSchema.SamplingMessage.builder()\n            .role(McpSchema.Role.USER)\n            .content(McpSchema.TextContent.builder(\"Test Sampling Message\").build())\n            .build()\n    ))\n    .maxTokens(50)\n    .build();\n```\n\nIt's also worth noting that some builders have APIs like `ModelPreferences#addHint`. If that pattern were applied consistently, it could be simplified a little more by replacing `messages(List.of(` with `addMessage(`\n\n## Beyond readability\n\nI'm writing a framework and builders enforcing all required params at once makes them inflexible for some possible API designs. \n\nFor example, my framework automatically manages progress tokens. I considered a design such as\n\n```java\nvoid sendProgress(Consumer\u003cMcpSchema.ProgressNotification.Builder\u003e consumer);\n\n// an example caller. mcp creates the builder and applies the token\nmcp.sendProgress(p -\u003e p.progress(5).total(10));\n```\n\nHowever, it's not possible for the framework to implement this with the current builder methods. The user of the framework knows the progress value, the framework itself knows the progress token, but the builder expects both at once.\n\nSo the builder has to be worked around, for example to this\n\n```java\nvoid sendProgress(double progress, Consumer\u003cMcpSchema.ProgressNotification.Builder\u003e consumer);\n// an example caller\nmcp.sendProgress(5, p -\u003e p.total(10));\n```","author":{"url":"https://github.com/michaelboyles","@type":"Person","name":"michaelboyles"},"datePublished":"2026-07-18T02:11:26.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1065/java-sdk/issues/1065"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:0a34feea-1961-2f09-5909-887b21076b7d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id82A6:35CFD7:43B7DC:5A896D:6A5ED4F6
html-safe-nonced746606f42412b4dd6e34fb6e31e67e001cee4add21d2a20f0cc72245089d106
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MkE2OjM1Q0ZENzo0M0I3REM6NUE4OTZEOjZBNUVENEY2IiwidmlzaXRvcl9pZCI6IjkxMDA5OTgyNzk5NTg1NDk3NTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac4ffa22bc9b659c537d108fdb7f04e2162d4d4720cb942a52c8f8665dbb4fbf9e
hovercard-subject-tagissue:4916216273
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/java-sdk/1065/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c8ef24a24fb660445eeba967d371b74cbf6f8462370a669a0d9ff207b3c45495/modelcontextprotocol/java-sdk/issues/1065
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c8ef24a24fb660445eeba967d371b74cbf6f8462370a669a0d9ff207b3c45495/modelcontextprotocol/java-sdk/issues/1065
og:image:alt#928 deprecated no-arg builders for schema types, e.g. McpSchema.Resource I'd like you to consider reversing that decision, and also to add no-arg versions for types without them (e.g. ProgressNoti...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemichaelboyles
hostnamegithub.com
expected-hostnamegithub.com
None82d0004a35927bdb00c652a57f456c55aa0eda4ade1bc7956d7510fdea6e454b
turbo-cache-controlno-preview
go-importgithub.com/modelcontextprotocol/java-sdk git https://github.com/modelcontextprotocol/java-sdk.git
octolytics-dimension-user_id182288589
octolytics-dimension-user_loginmodelcontextprotocol
octolytics-dimension-repository_id919609219
octolytics-dimension-repository_nwomodelcontextprotocol/java-sdk
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id919609219
octolytics-dimension-repository_network_root_nwomodelcontextprotocol/java-sdk
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
released2d913dd727d2d7ac189fb4d05b10bc34ecd03ee
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/java-sdk/issues/1065#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fjava-sdk%2Fissues%2F1065
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fjava-sdk%2Fissues%2F1065
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=modelcontextprotocol%2Fjava-sdk
Reloadhttps://github.com/modelcontextprotocol/java-sdk/issues/1065
Reloadhttps://github.com/modelcontextprotocol/java-sdk/issues/1065
Reloadhttps://github.com/modelcontextprotocol/java-sdk/issues/1065
Please reload this pagehttps://github.com/modelcontextprotocol/java-sdk/issues/1065
modelcontextprotocol https://github.com/modelcontextprotocol
java-sdkhttps://github.com/modelcontextprotocol/java-sdk
Notifications https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fjava-sdk
Fork 979 https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fjava-sdk
Star 3.6k https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fjava-sdk
Code https://github.com/modelcontextprotocol/java-sdk
Issues 135 https://github.com/modelcontextprotocol/java-sdk/issues
Pull requests 147 https://github.com/modelcontextprotocol/java-sdk/pulls
Discussions https://github.com/modelcontextprotocol/java-sdk/discussions
Actions https://github.com/modelcontextprotocol/java-sdk/actions
Projects https://github.com/modelcontextprotocol/java-sdk/projects
Models https://github.com/modelcontextprotocol/java-sdk/models
Security and quality 2 https://github.com/modelcontextprotocol/java-sdk/security
Insights https://github.com/modelcontextprotocol/java-sdk/pulse
Code https://github.com/modelcontextprotocol/java-sdk
Issues https://github.com/modelcontextprotocol/java-sdk/issues
Pull requests https://github.com/modelcontextprotocol/java-sdk/pulls
Discussions https://github.com/modelcontextprotocol/java-sdk/discussions
Actions https://github.com/modelcontextprotocol/java-sdk/actions
Projects https://github.com/modelcontextprotocol/java-sdk/projects
Models https://github.com/modelcontextprotocol/java-sdk/models
Security and quality https://github.com/modelcontextprotocol/java-sdk/security
Insights https://github.com/modelcontextprotocol/java-sdk/pulse
Un-deprecate/add no-arg buildershttps://github.com/modelcontextprotocol/java-sdk/issues/1065#top
https://github.com/michaelboyles
michaelboyleshttps://github.com/michaelboyles
on Jul 18, 2026https://github.com/modelcontextprotocol/java-sdk/issues/1065#issue-4916216273
#928https://github.com/modelcontextprotocol/java-sdk/pull/928
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.