Repository navigation
Conversation
make_custom_prompt registered every YAML-defined prompt (with and without
parameters) as a function returning a bare Message. FastMCP 4.x, which this
project requires (fastmcp>=4.0.2), renders a prompt only when it returns str,
list[Message] or PromptResult, so every custom prompt failed on prompts/get:
Prompt must return str, list[Message], or PromptResult, got Message
Both branches now return [Message(...)]. Tools were never affected.
Adds tests/phase0/test_custom_prompt_return_shape.py (no database needed):
the FastMCP contract (bare Message rejected, list rendered) and a check that
both prompt functions in make_custom_prompt return a list. Fails before the
change, passes after.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every prompt registered through
make_custom_prompt(the*_objects.ymlprompts, with and without parameters) fails onprompts/get:make_custom_promptreturns a bareMessagefrom both prompt functions. FastMCP 4.x, which this project requires (fastmcp>=4.0.2), only renders a prompt that returnsstr,list[Message]orPromptResult. Tools are unaffected; only prompt rendering breaks.Reproduced in-process on fastmcp 4.1.4 / mcp 2.3.0: a prompt returning
Message(...)fails with the error above, the same prompt returning[Message(...)]renders.Fix
Both branches of
make_custom_promptnow return[Message(...)](two lines insrc/teradata_mcp_server/app.py).Test
tests/phase0/test_custom_prompt_return_shape.py, no database needed:Messageis rejected, a list renders;make_custom_promptreturn a list.It fails before the change and passes after (
pytest tests/phase0/test_custom_prompt_return_shape.py→ 3 passed).