@@ -7,7 +7,7 @@ sidebarTitle: client
77
88## Classes
99
10- ### ` ClientSessionState ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L97 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
10+ ### ` ClientSessionState ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L96 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
1111
1212
1313Holds all session-related state for a Client instance.
@@ -16,13 +16,13 @@ This allows clean separation of configuration (which is copied) from
1616session state (which should be fresh for each new client instance).
1717
1818
19- ### ` CallToolResult ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L114 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
19+ ### ` CallToolResult ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L113 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
2020
2121
2222Parsed result from a tool call.
2323
2424
25- ### ` Client ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L124 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
25+ ### ` Client ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L123 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
2626
2727
2828MCP client that delegates connection management to a Transport instance.
@@ -85,7 +85,7 @@ async with client:
8585
8686** Methods:**
8787
88- #### ` session ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L371 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
88+ #### ` session ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L370 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
8989
9090``` python
9191session(self ) -> ClientSession
@@ -94,7 +94,7 @@ session(self) -> ClientSession
9494Get the current active session. Raises RuntimeError if not connected.
9595
9696
97- #### ` initialize_result ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L381 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
97+ #### ` initialize_result ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L380 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
9898
9999``` python
100100initialize_result(self ) -> mcp.types.InitializeResult | None
@@ -103,7 +103,7 @@ initialize_result(self) -> mcp.types.InitializeResult | None
103103Get the result of the initialization request.
104104
105105
106- #### ` set_roots ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L385 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
106+ #### ` set_roots ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L384 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
107107
108108``` python
109109set_roots(self , roots: RootsList | RootsHandler) -> None
@@ -112,7 +112,7 @@ set_roots(self, roots: RootsList | RootsHandler) -> None
112112Set the roots for the client. This does not automatically call ` send_roots_list_changed ` .
113113
114114
115- #### ` set_sampling_callback ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L389 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
115+ #### ` set_sampling_callback ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L388 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
116116
117117``` python
118118set_sampling_callback(self , sampling_callback: SamplingHandler, sampling_capabilities: mcp.types.SamplingCapability | None = None ) -> None
@@ -121,7 +121,7 @@ set_sampling_callback(self, sampling_callback: SamplingHandler, sampling_capabil
121121Set the sampling callback for the client.
122122
123123
124- #### ` set_elicitation_callback ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L404 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
124+ #### ` set_elicitation_callback ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L403 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
125125
126126``` python
127127set_elicitation_callback(self , elicitation_callback: ElicitationHandler) -> None
@@ -130,7 +130,7 @@ set_elicitation_callback(self, elicitation_callback: ElicitationHandler) -> None
130130Set the elicitation callback for the client.
131131
132132
133- #### ` is_connected ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L412 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
133+ #### ` is_connected ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L411 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
134134
135135``` python
136136is_connected(self ) -> bool
@@ -139,7 +139,7 @@ is_connected(self) -> bool
139139Check if the client is currently connected.
140140
141141
142- #### ` new ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L416 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
142+ #### ` new ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L415 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
143143
144144``` python
145145new(self ) -> Client[ClientTransportT]
@@ -155,7 +155,7 @@ share state with the original client.
155155- A new Client instance with the same configuration but disconnected state.
156156
157157
158- #### ` initialize ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L461 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
158+ #### ` initialize ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L476 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
159159
160160``` python
161161initialize(self , timeout: datetime.timedelta | float | int | None = None ) -> mcp.types.InitializeResult
@@ -183,13 +183,13 @@ capabilities, protocol version, and optional instructions.
183183- ` RuntimeError ` : If the client is not connected or initialization times out.
184184
185185
186- #### ` close ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L762 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
186+ #### ` close ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L786 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
187187
188188``` python
189189close(self )
190190```
191191
192- #### ` ping ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L768 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
192+ #### ` ping ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L792 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
193193
194194``` python
195195ping(self ) -> bool
@@ -198,7 +198,7 @@ ping(self) -> bool
198198Send a ping request.
199199
200200
201- #### ` cancel ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L773 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
201+ #### ` cancel ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L797 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
202202
203203``` python
204204cancel(self , request_id: str | int , reason: str | None = None ) -> None
@@ -207,7 +207,7 @@ cancel(self, request_id: str | int, reason: str | None = None) -> None
207207Send a cancellation notification for an in-progress request.
208208
209209
210- #### ` progress ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L790 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
210+ #### ` progress ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L814 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
211211
212212``` python
213213progress(self , progress_token: str | int , progress: float , total: float | None = None , message: str | None = None ) -> None
@@ -216,7 +216,7 @@ progress(self, progress_token: str | int, progress: float, total: float | None =
216216Send a progress notification.
217217
218218
219- #### ` set_logging_level ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L802 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
219+ #### ` set_logging_level ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L826 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
220220
221221``` python
222222set_logging_level(self , level: mcp.types.LoggingLevel) -> None
@@ -225,7 +225,7 @@ set_logging_level(self, level: mcp.types.LoggingLevel) -> None
225225Send a logging/setLevel request.
226226
227227
228- #### ` send_roots_list_changed ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L806 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
228+ #### ` send_roots_list_changed ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L830 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
229229
230230``` python
231231send_roots_list_changed(self ) -> None
@@ -234,7 +234,7 @@ send_roots_list_changed(self) -> None
234234Send a roots/list_changed notification.
235235
236236
237- #### ` complete_mcp ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L812 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
237+ #### ` complete_mcp ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L836 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
238238
239239``` python
240240complete_mcp(self , ref: mcp.types.ResourceTemplateReference | mcp.types.PromptReference, argument: dict[str , str ], context_arguments: dict[str , Any] | None = None ) -> mcp.types.CompleteResult
@@ -257,7 +257,7 @@ containing the completion and any additional metadata.
257257- ` McpError ` : If the request results in a TimeoutError | JSONRPCError
258258
259259
260- #### ` complete ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L843 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
260+ #### ` complete ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L867 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
261261
262262``` python
263263complete(self , ref: mcp.types.ResourceTemplateReference | mcp.types.PromptReference, argument: dict[str , str ], context_arguments: dict[str , Any] | None = None ) -> mcp.types.Completion
@@ -279,7 +279,7 @@ include with the completion request. Defaults to None.
279279- ` McpError ` : If the request results in a TimeoutError | JSONRPCError
280280
281281
282- #### ` generate_name ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L870 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
282+ #### ` generate_name ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/client/client.py#L894 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
283283
284284``` python
285285generate_name(cls , name: str | None = None ) -> str
0 commit comments