docs/python-sdk/fastmcp-server-providers-openapi-components.mdx
fastmcp.server.providers.openapi.componentsOpenAPI component classes: Tool, Resource, and ResourceTemplate.
OpenAPITool <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/server/providers/openapi/components.py#L138" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Tool implementation for OpenAPI endpoints.
Methods:
run <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/server/providers/openapi/components.py#L180" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>run(self, arguments: dict[str, Any]) -> ToolResult
Execute the HTTP request using RequestDirector.
OpenAPIResource <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/server/providers/openapi/components.py#L257" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Resource implementation for OpenAPI endpoints.
Methods:
read <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/server/providers/openapi/components.py#L287" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>read(self) -> ResourceResult
Fetch the resource data by making an HTTP request.
OpenAPIResourceTemplate <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/server/providers/openapi/components.py#L371" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Resource template implementation for OpenAPI endpoints.
Methods:
create_resource <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/server/providers/openapi/components.py#L403" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>create_resource(self, uri: str, params: dict[str, Any], context: Context | None = None) -> Resource
Create a resource with the given parameters.