René's URL Explorer Experiment


Title: [Specification] Reframe sampling as a basis for bidirectional agent-to-agent communication · Issue #503 · modelcontextprotocol/modelcontextprotocol · GitHub

Open Graph Title: [Specification] Reframe sampling as a basis for bidirectional agent-to-agent communication · Issue #503 · modelcontextprotocol/modelcontextprotocol

X Title: [Specification] Reframe sampling as a basis for bidirectional agent-to-agent communication · Issue #503 · modelcontextprotocol/modelcontextprotocol

Description: Is your feature request related to a problem? Please describe. Sampling in its current form is a powerful tool, featuring support for: Preloaded message histories: The server can preload a conversation history in the messages property of...

Open Graph Description: Is your feature request related to a problem? Please describe. Sampling in its current form is a powerful tool, featuring support for: Preloaded message histories: The server can preload a conversa...

X Description: Is your feature request related to a problem? Please describe. Sampling in its current form is a powerful tool, featuring support for: Preloaded message histories: The server can preload a conversa...

Opengraph URL: https://github.com/modelcontextprotocol/modelcontextprotocol/issues/503

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Specification] Reframe sampling as a basis for bidirectional agent-to-agent communication","articleBody":"**Is your feature request related to a problem? Please describe.**\nSampling in its current form is a powerful tool, featuring support for:\n- **Preloaded message histories:** The server can preload a conversation history in the `messages` property of the sampling request, and have the client LLM generate the next message in the conversation. The server can also send new sampling requests with any subset (real or fictional) of a conversation history to induce a given client response (setting context security aside for the moment -- that is important but deserves its own discussion).\n- **Context sharing:** The server can summarize information into the `systemPrompt` property to bootstrap a collaborative task. The server can also suggest a context the client should use when responding, via the undocumented `includeContext` property.\n- **Nested execution:** The server can dispatch sampling requests at any time, such as within an active tool call. Combining tool calls with sampling enables collaborative task execution.\n\nDespite being documented as a solution for agentic behaviors, [sampling](https://modelcontextprotocol.io/specification/2025-03-26/client/sampling) has seen very limited uptake for this purpose, even in toy examples. [Issues](https://github.com/modelcontextprotocol/modelcontextprotocol/issues?q=is%3Aissue%20sampling) and [discussions](https://github.com/modelcontextprotocol/modelcontextprotocol/discussions?discussions_q=sampling) related to sampling are also scarce, and only a small number discuss improvements that can be made for agent communication (honorable mentions: #105, #124, #186). The proposed spec for elicitations (#382) also overlaps significantly with what sampling in its flow, but has a distinctly-different use case (requesting data from a human, bypassing model ambiguity).\n\nI think the understated importance of sampling is the result of several interrelated issues:\n1. **Poorly-documented usage patterns:** I imagine this is at least partially because demonstrating how sampling can actually be used is hard to do in an easily-digestible manner. I tried my hand at a simple two-agent deep sequence diagram and it's 63 lines long (I'll include it in a separate comment). Usage with tools is actually not discussed at all in either the specification or the docs, which is a huge gap when it comes to conceptualizing sampling in general. It's very unintuitive to imagine sampling outside of the context of using it in response to a tool call (even if there may be use cases for this). This is really a microcosm of a broader documentation gap around building end-to-end MCP applications.\n2. **Documentation noise:** A significant portion of the sampling specification and documentation is devoted to clarifying the usage of `modelPreferences`, which is perhaps the least-important aspect of the specification.\n3. **Lack of cohesion with other protocol elements:** Resources and Embedded Resources are not supported as message types.\n4. **Lack of client support:** [Almost zero](https://modelcontextprotocol.io/clients) end-user clients support sampling at all, likely because few servers use it (and servers are unlikely to use it if clients don't support it).\n\n**Describe the solution you'd like**\n1. Update the documentation to offer specific working examples of sampling in at least one SDK.\n2. Update the documentation and the specification to discuss using `messages` and `systemPrompt` for interesting tasks.\n3. Update the documentation and the specification to discuss using sampling with tool calls and other specification features.\n4. Revise the specification to add support for Resources and Embedded Resources in sampling messages.\n5. Revise the specification to define the existing `includeContext` property.\n\n**Describe alternatives you've considered**\n- [A2A](https://google.github.io/A2A/topics/a2a-and-mcp/) and [ACP](https://agentcommunicationprotocol.dev/about/mcp-and-a2a) support agent-to-agent communication with their own mechanisms on top of MCP, and interestingly don't mention sampling in their justifications for standing up new agent-oriented protocols at all -- I don't believe that this was (entirely) for business/product reasons, but rather is a consequence of the how the specification and documentation don't do a good job of framing sampling as a potential solution for that problem.","author":{"url":"https://github.com/LucaButBoring","@type":"Person","name":"LucaButBoring"},"datePublished":"2025-05-09T23:24:12.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":16},"url":"https://github.com/503/modelcontextprotocol/issues/503"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:78b6432e-e2fe-ed8d-ee38-0f2cf98ea3a1
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAD22:7B76D:96A58B:C990B9:6A593A06
html-safe-nonce0020e9e2b9ab691dd2bbcfcf905ca2c5b566c55e14b1878a4c0494bbd1f675b9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRDIyOjdCNzZEOjk2QTU4QjpDOTkwQjk6NkE1OTNBMDYiLCJ2aXNpdG9yX2lkIjoiMzk3OTU3MDkwOTg4NzkzNzAzMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac81cf98c273a5a59975b51a3d7e0f79ceea3118fece0f981727c4227da4ad8c2e
hovercard-subject-tagissue:3053380213
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/modelcontextprotocol/503/issue_layout
twitter:imagehttps://opengraph.githubassets.com/971d7c0a1830f59034d155c6d04ef5666a372750847390d401e3ab9476a08672/modelcontextprotocol/modelcontextprotocol/issues/503
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/971d7c0a1830f59034d155c6d04ef5666a372750847390d401e3ab9476a08672/modelcontextprotocol/modelcontextprotocol/issues/503
og:image:altIs your feature request related to a problem? Please describe. Sampling in its current form is a powerful tool, featuring support for: Preloaded message histories: The server can preload a conversa...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameLucaButBoring
hostnamegithub.com
expected-hostnamegithub.com
None1b31c9453e1607b2781513084b4770f67217e549834c85b76960d7b13626f7c8
turbo-cache-controlno-preview
go-importgithub.com/modelcontextprotocol/modelcontextprotocol git https://github.com/modelcontextprotocol/modelcontextprotocol.git
octolytics-dimension-user_id182288589
octolytics-dimension-user_loginmodelcontextprotocol
octolytics-dimension-repository_id862570523
octolytics-dimension-repository_nwomodelcontextprotocol/modelcontextprotocol
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id862570523
octolytics-dimension-repository_network_root_nwomodelcontextprotocol/modelcontextprotocol
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
release220f27779da5b92b5e17fcaef93e474cc8affba3
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/modelcontextprotocol/issues/503#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fmodelcontextprotocol%2Fissues%2F503
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
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%2Fmodelcontextprotocol%2Fissues%2F503
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%2Fmodelcontextprotocol
Reloadhttps://github.com/modelcontextprotocol/modelcontextprotocol/issues/503
Reloadhttps://github.com/modelcontextprotocol/modelcontextprotocol/issues/503
Reloadhttps://github.com/modelcontextprotocol/modelcontextprotocol/issues/503
Please reload this pagehttps://github.com/modelcontextprotocol/modelcontextprotocol/issues/503
modelcontextprotocol https://github.com/modelcontextprotocol
modelcontextprotocolhttps://github.com/modelcontextprotocol/modelcontextprotocol
Notifications https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fmodelcontextprotocol
Fork 1.7k https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fmodelcontextprotocol
Star 8.6k https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fmodelcontextprotocol
Code https://github.com/modelcontextprotocol/modelcontextprotocol
Issues 113 https://github.com/modelcontextprotocol/modelcontextprotocol/issues
Pull requests 80 https://github.com/modelcontextprotocol/modelcontextprotocol/pulls
Discussions https://github.com/modelcontextprotocol/modelcontextprotocol/discussions
Actions https://github.com/modelcontextprotocol/modelcontextprotocol/actions
Projects https://github.com/modelcontextprotocol/modelcontextprotocol/projects
Models https://github.com/modelcontextprotocol/modelcontextprotocol/models
Security and quality 0 https://github.com/modelcontextprotocol/modelcontextprotocol/security
Insights https://github.com/modelcontextprotocol/modelcontextprotocol/pulse
Code https://github.com/modelcontextprotocol/modelcontextprotocol
Issues https://github.com/modelcontextprotocol/modelcontextprotocol/issues
Pull requests https://github.com/modelcontextprotocol/modelcontextprotocol/pulls
Discussions https://github.com/modelcontextprotocol/modelcontextprotocol/discussions
Actions https://github.com/modelcontextprotocol/modelcontextprotocol/actions
Projects https://github.com/modelcontextprotocol/modelcontextprotocol/projects
Models https://github.com/modelcontextprotocol/modelcontextprotocol/models
Security and quality https://github.com/modelcontextprotocol/modelcontextprotocol/security
Insights https://github.com/modelcontextprotocol/modelcontextprotocol/pulse
[Specification] Reframe sampling as a basis for bidirectional agent-to-agent communicationhttps://github.com/modelcontextprotocol/modelcontextprotocol/issues/503#top
enhancementNew feature or requesthttps://github.com/modelcontextprotocol/modelcontextprotocol/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com/LucaButBoring
LucaButBoringhttps://github.com/LucaButBoring
on May 9, 2025https://github.com/modelcontextprotocol/modelcontextprotocol/issues/503#issue-3053380213
samplinghttps://modelcontextprotocol.io/specification/2025-03-26/client/sampling
Issueshttps://github.com/modelcontextprotocol/modelcontextprotocol/issues?q=is%3Aissue%20sampling
discussionshttps://github.com/modelcontextprotocol/modelcontextprotocol/discussions?discussions_q=sampling
#105https://github.com/modelcontextprotocol/modelcontextprotocol/issues/105
#124https://github.com/modelcontextprotocol/modelcontextprotocol/discussions/124
#186https://github.com/modelcontextprotocol/modelcontextprotocol/discussions/186
#382https://github.com/modelcontextprotocol/modelcontextprotocol/pull/382
Almost zerohttps://modelcontextprotocol.io/clients
A2Ahttps://google.github.io/A2A/topics/a2a-and-mcp/
ACPhttps://agentcommunicationprotocol.dev/about/mcp-and-a2a
enhancementNew feature or requesthttps://github.com/modelcontextprotocol/modelcontextprotocol/issues?q=state%3Aopen%20label%3A%22enhancement%22
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.