Skip to content

Include context into completions #634

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

Merged
merged 6 commits into from
Jun 16, 2025
Merged

Conversation

ihrpr
Copy link
Contributor

@ihrpr ihrpr commented Jun 16, 2025

Details: modelcontextprotocol/modelcontextprotocol#598
Closes #603


  • Added optional context field to CompleteRequest schema with arguments for previously-resolved variables
  • Updated CompleteCallback and CompleteResourceTemplateCallback to accept context parameter
  • Updated server handlers to pass context to completion callbacks

This PR enable dependent completions where later parameters can use earlier resolved values (e.g., repository suggestions based on selected owner).

@ihrpr ihrpr requested a review from bhosmer-ant June 16, 2025 14:20
Copy link
Contributor

@bhosmer-ant bhosmer-ant left a comment

Choose a reason for hiding this comment

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

Looks good!

Nice to have for later: some help from the SDK in checking that args 0..n-1 have been resolved when requesting a completion for arg n.

@bhosmer-ant bhosmer-ant merged commit e89137f into main Jun 16, 2025
5 checks passed
@bhosmer-ant bhosmer-ant deleted the ihrpr/context-for-completable branch June 16, 2025 15:11
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.

include previously-resolved variables in completions request
2 participants