fastmcp.utilities.openapi.formatters
Parameter formatting functions for OpenAPI operations.
Functions
format_array_parameter
values: List of values to formatparameter_name: Name of the parameter (for error messages)is_query_parameter: If True, can return list for explode=True behavior
- String (comma-separated) or list (for query params with explode=True)
format_deep_object_parameter
{"id": "123", "type": "user"} becomes
param[id]=123¶m[type]=user.
Args:
param_value: Dictionary value to formatparameter_name: Name of the parameter
- Dictionary with bracketed parameter names as keys
generate_example_from_schema
format_json_for_description
format_simple_description
base_description: The initial description to be formatted.parameters: A list of parameter information.request_body: Information about the request body.
- The formatted description string with minimal details.
format_description_with_responses
base_description: The initial description to be formatted.responses: A dictionary of response information, keyed by status code.parameters: A list of parameter information, including path and query parameters. Each parameter includes details such as name, location, whether it is required, and a description.request_body: Information about the request body, including its description, whether it is required, and its content schema.
- The formatted description string with additional details about responses, parameters,
- and the request body.

