mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-09 23:29:10 +02:00
Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
36 lines
1.1 KiB
Text
36 lines
1.1 KiB
Text
---
|
|
title: director
|
|
sidebarTitle: director
|
|
---
|
|
|
|
# `fastmcp.utilities.openapi.director`
|
|
|
|
|
|
Request director using openapi-core for stateless HTTP request building.
|
|
|
|
## Classes
|
|
|
|
### `RequestDirector` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/utilities/openapi/director.py#L28" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
|
|
|
|
|
Builds httpx.Request objects from HTTPRoute and arguments using openapi-core.
|
|
|
|
|
|
**Methods:**
|
|
|
|
#### `build` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/utilities/openapi/director.py#L35" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
|
|
|
```python
|
|
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
|
|
|