Neil Conway commited on
Commit
199f3e5
·
unverified ·
1 Parent(s): 798d2ed

Fix docstring format for fastmcp.client.Client (#1094)

Browse files
Files changed (1) hide show
  1. src/fastmcp/client/client.py +17 -12
src/fastmcp/client/client.py CHANGED
@@ -93,13 +93,16 @@ class Client(Generic[ClientTransportT]):
93
  https://github.com/jlowin/fastmcp/pull/1054
94
 
95
  Args:
96
- transport: Connection source specification, which can be:
97
- - ClientTransport: Direct transport instance
98
- - FastMCP: In-process FastMCP server
99
- - AnyUrl | str: URL to connect to
100
- - Path: File path for local socket
101
- - MCPConfig: MCP server configuration
102
- - dict: Transport configuration
 
 
 
103
  roots: Optional RootsList or RootsHandler for filesystem access
104
  sampling_handler: Optional handler for sampling requests
105
  log_handler: Optional handler for log messages
@@ -110,14 +113,16 @@ class Client(Generic[ClientTransportT]):
110
  Set to 0 to disable. If None, uses the value in the FastMCP global settings.
111
 
112
  Examples:
113
- ```python # Connect to FastMCP server client =
114
- Client("http://localhost:8080")
 
115
 
116
  async with client:
117
- # List available resources resources = await client.list_resources()
 
118
 
119
- # Call a tool result = await client.call_tool("my_tool", {"param":
120
- "value"})
121
  ```
122
  """
123
 
 
93
  https://github.com/jlowin/fastmcp/pull/1054
94
 
95
  Args:
96
+ transport:
97
+ Connection source specification, which can be:
98
+
99
+ - ClientTransport: Direct transport instance
100
+ - FastMCP: In-process FastMCP server
101
+ - AnyUrl or str: URL to connect to
102
+ - Path: File path for local socket
103
+ - MCPConfig: MCP server configuration
104
+ - dict: Transport configuration
105
+
106
  roots: Optional RootsList or RootsHandler for filesystem access
107
  sampling_handler: Optional handler for sampling requests
108
  log_handler: Optional handler for log messages
 
113
  Set to 0 to disable. If None, uses the value in the FastMCP global settings.
114
 
115
  Examples:
116
+ ```python
117
+ # Connect to FastMCP server
118
+ client = Client("http://localhost:8080")
119
 
120
  async with client:
121
+ # List available resources
122
+ resources = await client.list_resources()
123
 
124
+ # Call a tool
125
+ result = await client.call_tool("my_tool", {"param": "value"})
126
  ```
127
  """
128