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
I have checked that this question would not be more appropriate as an issue in a specific repository
I have searched existing discussions and documentation for answers
Question Category
Protocol Specification
SDK Usage
Server Implementation
General Implementation
Documentation
Other
Your Question
In the MCP server python example, weather.py (https://modelcontextprotocol.io/docs/develop/build-server), tools are defined using the @mcp.tool() decorator on global methods get_alerts(state) and get_forecast(lat, long). Does the caller of the tool (the client?) have any more information than the function signature of the tool's method and perhaps the parameter names? Is there some magic by which the mcp library can introspect the tool method's docstrings or the method's code?
Otherwise, I would expect that get_alerts(state: str) would not provide the client enough of a clue as to what a valid input param should be -- in this case a 2-letter USA state code. Are detailed docstrings a requirement. Are there other recommended ways to provide parameter hints to the client?
Also, this screen-shot from the tutorial is confusing (apologies if this is the wrong forum):
"View result from get-weather from weather (local)" I assume get_forecast() may have been named get_weather() at some point.
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.
-
Pre-submission Checklist
Question Category
Your Question
In the MCP server python example, weather.py (https://modelcontextprotocol.io/docs/develop/build-server), tools are defined using the
@mcp.tool()decorator on global methods get_alerts(state) and get_forecast(lat, long). Does the caller of the tool (the client?) have any more information than the function signature of the tool's method and perhaps the parameter names? Is there some magic by which the mcp library can introspect the tool method's docstrings or the method's code?Otherwise, I would expect that get_alerts(state: str) would not provide the client enough of a clue as to what a valid input param should be -- in this case a 2-letter USA state code. Are detailed docstrings a requirement. Are there other recommended ways to provide parameter hints to the client?
Also, this screen-shot from the tutorial is confusing (apologies if this is the wrong forum):

"View result from get-weather from weather (local)" I assume get_forecast() may have been named get_weather() at some point.
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions