Skip to content
Discussion options

You must be logged in to vote

You bring up some good points. Let's address them one-by-one:

Are detailed docstrings a requirement?

No. As written in the example, the LLM will probably read the docstring for the get_alerts async function and see that state is expected to be a two-character US state abbreviation. However, that's not a durable pattern for production since it relies on model compliance with no runtime validation.

Are there other recommended ways to provide parameter hints to the client?

There's no officially recommended way in the MCP docs, but you can add validation using Pydantic's Field (which is already a transitive dependency of the MCP SDK).

async def get_alerts(
    state: Annotated[str, Field(m…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bsloan666
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants