fastmcp.utilities.openapi
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
parse_openapi_to_http_routes
clean_schema_for_display
generate_example_from_schema
format_json_for_description
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.
extract_output_schema_from_responses
responses: Dictionary of ResponseInfo objects keyed by status codeschema_definitions: Optional schema definitions to include in the output schemaopenapi_version: OpenAPI version string, used to optimize nullable field handling
- MCP-compliant output schema with potential wrapping, or None if no suitable schema found

