fix: add optional timeout to McpClient::send_request() (#852)
We now impose a 10s timeout on the initial `tools/list` request to an MCP server. We do not apply a timeout for other types of requests yet, but we should start enforcing those, as well.
This commit is contained in:
@@ -34,8 +34,9 @@ async fn main() -> Result<()> {
|
||||
.with_context(|| format!("failed to spawn subprocess: {original_args:?}"))?;
|
||||
|
||||
// Issue `tools/list` request (no params).
|
||||
let timeout = None;
|
||||
let tools = client
|
||||
.list_tools(None::<ListToolsRequestParams>)
|
||||
.list_tools(None::<ListToolsRequestParams>, timeout)
|
||||
.await
|
||||
.context("tools/list request failed")?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user