From 47101eeccd6c5e054dc522bbee5b508810e62f25 Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Date: Wed, 24 Jun 2026 11:52:05 -0400 Subject: [PATCH] fix: RST docstrings in fastmcp.types render raw on gofastmcp.com (#4367) Co-authored-by: Justin van Zyl --- fastmcp_slim/fastmcp/types.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/fastmcp_slim/fastmcp/types.py b/fastmcp_slim/fastmcp/types.py index f078ceb6b..5d9e30cc7 100644 --- a/fastmcp_slim/fastmcp/types.py +++ b/fastmcp_slim/fastmcp/types.py @@ -1,19 +1,21 @@ """Reusable type annotations for FastMCP tool parameters. These types can be used in tool function signatures to influence how -parameters are presented in UIs (e.g. ``fastmcp dev apps``) and +parameters are presented in UIs (e.g. `fastmcp dev apps`) and serialized in JSON Schema. -Example:: +Example: - from fastmcp import FastMCP - from fastmcp.types import Textarea +```python +from fastmcp import FastMCP +from fastmcp.types import Textarea - mcp = FastMCP("demo") +mcp = FastMCP("demo") - @mcp.tool() - def run_query(sql: Textarea) -> str: - ... +@mcp.tool() +def run_query(sql: Textarea) -> str: + ... +``` """ from __future__ import annotations @@ -25,8 +27,8 @@ from pydantic import Field Textarea = Annotated[str, Field(json_schema_extra={"format": "textarea"})] """A string rendered as a multiline textarea in form-based UIs. -Produces ``"format": "textarea"`` in the JSON Schema, which -``fastmcp dev apps`` picks up automatically. +Produces `"format": "textarea"` in the JSON Schema, which +`fastmcp dev apps` picks up automatically. """ __all__ = ["Textarea"]