Skip to content
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

Returning multiple Resource and Tool results from FastMCP and Lowlevel #177

Closed
dsp-ant opened this issue Jan 28, 2025 · 0 comments · Fixed by #222
Closed

Returning multiple Resource and Tool results from FastMCP and Lowlevel #177

dsp-ant opened this issue Jan 28, 2025 · 0 comments · Fixed by #222
Labels
bug Something isn't working
Milestone

Comments

@dsp-ant
Copy link
Member

dsp-ant commented Jan 28, 2025

We currently do not support returning multiple values from resources and tools despite the spec explicitly allowing for it.

@dsp-ant dsp-ant added the bug Something isn't working label Jan 28, 2025
@dsp-ant dsp-ant added this to the SDK 1.3.x milestone Jan 28, 2025
dsp-ant added a commit that referenced this issue Feb 20, 2025
* feat: allow lowlevel servers to return a list of resources

The resource/read message in MCP allows of multiple resources
to be returned. However, in the SDK we do not allow this. This
change is such that we allow returning multiple resource in
the lowlevel API if needed. However in FastMCP we stick to
one, since a FastMCP resource defines the mime_type in the decorator
and hence a resource cannot dynamically return different mime_typed resources.
It also is just the better default to only return one resource.
However in the lowlevel API we will allow this.

Strictly speaking this is not a BC break since the new return value
is additive, but if people subclassed server, it will break them.

* feat: lower the type requriements for call_tool to Iterable
dsp-ant added a commit that referenced this issue Feb 20, 2025
* feat: allow lowlevel servers to return a list of resources

The resource/read message in MCP allows of multiple resources
to be returned. However, in the SDK we do not allow this. This
change is such that we allow returning multiple resource in
the lowlevel API if needed. However in FastMCP we stick to
one, since a FastMCP resource defines the mime_type in the decorator
and hence a resource cannot dynamically return different mime_typed resources.
It also is just the better default to only return one resource.
However in the lowlevel API we will allow this.

Strictly speaking this is not a BC break since the new return value
is additive, but if people subclassed server, it will break them.

* feat: lower the type requriements for call_tool to Iterable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant