Skip to content

Commit e37b7a8

Browse files
committed
fix: Increase duration of dad-jokes function to prevent timeouts
1 parent 8a5dfea commit e37b7a8

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

examples/servers/dad-jokes/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,23 @@ cdk deploy --app 'python3 cdk_stack.py'
1818
```
1919

2020
See the [development guide](/DEVELOP.md) for full instructions to deploy and run the examples in this repository.
21+
22+
### Local Testing
23+
24+
Sample inputs:
25+
26+
```bash
27+
cd function
28+
29+
uv pip install -r requirements.txt
30+
31+
# Initialize
32+
$ python -c 'import index; print(index.handler({"httpMethod": "POST", "headers": {"Accept": "application/json, text/event-stream", "content-type": "application/json"}, "body": "{\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2025-06-18\",\"capabilities\":{},\"clientInfo\":{\"name\":\"mcp\",\"version\":\"0.1.0\"}},\"jsonrpc\":\"2.0\",\"id\":0}"}, ""))'
33+
34+
# List tools
35+
$ python -c 'import index; print(index.handler({"httpMethod": "POST", "headers": {"Accept": "application/json, text/event-stream", "content-type": "application/json"}, "body": "{\"method\":\"tools/list\",\"params\":{\"protocolVersion\":\"2025-06-18\",\"capabilities\":{},\"clientInfo\":{\"name\":\"mcp\",\"version\":\"0.1.0\"}},\"jsonrpc\":\"2.0\",\"id\":0}"}, ""))'
36+
```
37+
38+
```
39+
{"httpMethod": "POST", "headers": {"Accept": "application/json, text/event-stream", "content-type": "application/json"}, "body": "{\"method\":\"tools/list\",\"params\":{\"protocolVersion\":\"2025-06-18\",\"capabilities\":{},\"clientInfo\":{\"name\":\"mcp\",\"version\":\"0.1.0\"}},\"jsonrpc\":\"2.0\",\"id\":0}"}
40+
```

examples/servers/dad-jokes/cdk_stack.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Aspects,
44
CfnOutput,
55
DockerVolume,
6+
Duration,
67
Environment,
78
Fn,
89
RemovalPolicy,
@@ -71,6 +72,7 @@ def __init__(
7172
runtime=lambda_.Runtime.PYTHON_3_13,
7273
entry="function",
7374
memory_size=2048,
75+
timeout=Duration.seconds(10),
7476
environment={
7577
"LOG_LEVEL": "DEBUG",
7678
},

0 commit comments

Comments
 (0)