Skip to main content

fastmcp.utilities.openapi.director

Request director using openapi-core for stateless HTTP request building.

Classes

RequestDirector

Builds httpx.Request objects from HTTPRoute and arguments using openapi-core. Methods:

build

build(self, route: HTTPRoute, flat_args: dict[str, Any], base_url: str = 'http://localhost') -> httpx.Request
Constructs a final httpx.Request object, handling all OpenAPI serialization. Args:
  • route: HTTPRoute containing OpenAPI operation details
  • flat_args: Flattened arguments from LLM (may include suffixed parameters)
  • base_url: Base URL for the request
Returns:
  • httpx.Request: Properly formatted HTTP request