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
docs: consolidate pytest-examples into single test and add skip tags
Consolidate the separate README.v2.md and docs/ pytest-examples tests
into a single unified test using `find_examples("README.v2.md", "docs/")`.
Add skip tags to pre-existing code blocks that aren't self-contained:
- migration.md: all blocks (before/after migration patterns)
- experimental/*.md: all blocks (experimental API patterns)
- testing.md: test blocks (reference local server module)
- README.v2.md: 4 context-dependent snippets
Copy file name to clipboardExpand all lines: docs/experimental/tasks-client.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ This guide covers calling task-augmented tools from clients, handling the `input
10
10
11
11
Call a tool as a task and poll for the result:
12
12
13
-
```python
13
+
```python skip="true"
14
14
from mcp.client.session import ClientSession
15
15
from mcp.types import CallToolResult
16
16
@@ -38,7 +38,7 @@ async with ClientSession(read, write) as session:
38
38
39
39
Use `call_tool_as_task()` to invoke a tool with task augmentation:
40
40
41
-
```python
41
+
```python skip="true"
42
42
result =await session.experimental.call_tool_as_task(
43
43
"my_tool", # Tool name
44
44
{"arg": "value"}, # Arguments
@@ -62,7 +62,7 @@ The response is a `CreateTaskResult` containing:
62
62
63
63
The `poll_task()` async iterator polls until the task reaches a terminal state:
64
64
65
-
```python
65
+
```python skip="true"
66
66
asyncfor status in session.experimental.poll_task(task_id):
67
67
print(f"Status: {status.status}")
68
68
if status.statusMessage:
@@ -79,7 +79,7 @@ It automatically:
79
79
80
80
When a task needs user input (elicitation), it transitions to `input_required`. You must call `get_task_result()` to receive and respond to the elicitation:
81
81
82
-
```python
82
+
```python skip="true"
83
83
asyncfor status in session.experimental.poll_task(task_id):
84
84
print(f"Status: {status.status}")
85
85
@@ -95,7 +95,7 @@ The elicitation callback (set during session creation) handles the actual user i
95
95
96
96
To handle elicitation requests from the server, provide a callback when creating the session:
97
97
98
-
```python
98
+
```python skip="true"
99
99
from mcp.types import ElicitRequestParams, ElicitResult
0 commit comments