You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there! I'm trying to build out a FastMCP server to expose some data analysis tools. I need to be able to handle a tool request like, "Pull up the data from last Monday," and if there is more than one file I would like to be able to leverage elicitiation to ask which file(s) to "load" into the session context.
At present it seems that only pydantic models containing scalars or nested pedantic models are allowed; trying to pass a list or even an Enum as an elicitation schema fails on the FastMCP side as being an invalid schema type since it doesn't subclass pydantic's BaseModel:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there! I'm trying to build out a FastMCP server to expose some data analysis tools. I need to be able to handle a tool request like, "Pull up the data from last Monday," and if there is more than one file I would like to be able to leverage elicitiation to ask which file(s) to "load" into the session context.
At present it seems that only pydantic models containing scalars or nested pedantic models are allowed; trying to pass a list or even an Enum as an elicitation schema fails on the FastMCP side as being an invalid schema type since it doesn't subclass pydantic's
BaseModel:It feels like a finite list of scalars could be handled by the EnumSchema defined in MCP...?
Running on Python 3.12.11, fastmcp==2.13.1, macOS.
Any suggestions on how to achieve this in FastMCP? Many thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions