Skip to content

[MCP][Utils] Add support for FastMCP processing #631

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Czhang0727
Copy link

Fixing issue #630

Problem:
In FastMCP, the structure did not have array data inside of result, instead, the result itself is the array itself. And the text field is used.

Add a type check, if we found it an array, simply merge all results with the content. Please find the fixed test project here: https://github.com/Czhang0727/object-rag

Copy link

This PR is stale because it has been open for 10 days with no activity.

@github-actions github-actions bot added the stale label May 11, 2025
@Czhang0727
Copy link
Author

seems no one is reviewing this change, plz let me know if there is any updates

@github-actions github-actions bot removed the stale label May 17, 2025
@rm-openai
Copy link
Collaborator

Sorry was out on vacation! Will take a closer look soon.

@rm-openai
Copy link
Collaborator

Not totally understanding the issue here. When would the return type not have content?

@Czhang0727
Copy link
Author

In the current code, we are expecting

result = {
content: [content_object]
}

in fastMCP, I got a response like

result = [content_object]

@rm-openai
Copy link
Collaborator

@Czhang0727 The spec is pretty clear that the response must be result: { content: [...] } } (https://modelcontextprotocol.io/specification/2025-03-26/server/tools#calling-tools).

So is it possible your server is not compliant?

@Czhang0727
Copy link
Author

hmm, in that case, fastMCP may have some issue, let me check the behavior and get back to the thread

Copy link

github-actions bot commented Jun 7, 2025

This PR is stale because it has been open for 10 days with no activity.

@github-actions github-actions bot added the stale label Jun 7, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants