docs/python-sdk/fastmcp-utilities-docstring_parsing.mdx
fastmcp.utilities.docstring_parsingExtract descriptions from function docstrings.
Uses griffelib to parse Google, NumPy, and Sphinx-style docstrings. The
interface is intentionally narrow — a single function returning a
ParsedDocstring — so the implementation can be swapped without touching
callers.
parse_docstring <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/utilities/docstring_parsing.py#L35" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>parse_docstring(fn: Callable[..., Any]) -> ParsedDocstring
Parse a function's docstring into a summary and parameter descriptions.
Tries Google, NumPy, and Sphinx parsers in order, using the first one that successfully extracts parameter descriptions. If none do, returns the full docstring as the description with no parameter descriptions.
ParsedDocstring <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/utilities/docstring_parsing.py#L28" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>The extracted description and per-parameter descriptions from a docstring.