You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fed94f8
Browse filesBrowse the repository at this point in the historyBrowse files
feat(fetch): make the HTTP request timeout configurable
The page request's 30 s timeout was hard-coded. It can now be set per
call with the fetch tool's timeout_ms argument (100 to 600000 ms,
advertised with the server default as its default), server-wide with
--timeout-ms or FETCH_TIMEOUT_MS, the most specific winning, and stays
30 s when none is given. A timed-out request says how long it waited.
The robots.txt check keeps httpx's own default.
Closes#4448
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: cliffhall <cliff@futurescale.com>
Copy file name to clipboardExpand all lines: src/fetch/README.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,7 @@ The fetch tool will truncate the response, but by using the `start_index` argume
22
22
-`max_length` (integer, optional): Maximum number of characters to return (default: 5000)
23
23
-`start_index` (integer, optional): Start content from this character index (default: 0)
24
24
-`raw` (boolean, optional): Get raw content without markdown conversion (default: false)
25
+
-`timeout_ms` (integer, optional): HTTP request timeout for this call, in milliseconds, from 100 to 600000 (default: the server's timeout, 30000 unless configured; see [Customization - Timeout](#customization---timeout))
25
26
- Annotations: `readOnlyHint: true`, `destructiveHint: false`, `idempotentHint: true`, `openWorldHint: true` (it only reads, and it reaches arbitrary hosts on the internet)
# subscriptions=False: the tool and prompt lists never change and there are
655
667
# no resources to watch, so `subscriptions/listen` is not served and the
@@ -703,6 +715,15 @@ async def fetch(
703
715
strict=True,
704
716
),
705
717
] =False,
718
+
timeout_ms: Annotated[
719
+
int,
720
+
Field(
721
+
description="How long to wait, in milliseconds, to connect to the server and for each read of its response before giving up. Raise it for a slow server or a large download; lower it to fail fast.",
# #4448: the server-wide timeout is the advertised default.
191
+
"timeout_ms": {
192
+
"default": 30000,
193
+
"description": "How long to wait, in milliseconds, to connect to the server and for each read of its response before giving up. Raise it for a slow server or a large download; lower it to fail fast.",
0 commit comments