Skip to content

Commit 4602139

Browse files
committed
add tests for sampling
1 parent 4d8b9c9 commit 4602139

File tree

40 files changed

+479
-152
lines changed

40 files changed

+479
-152
lines changed

epicshop/.diffignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.ignored.*
2+
*.ignored
3+
*.test.*
4+
package.json

exercises/01.ping/01.problem.connect/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@
1515
"zod": "^3.24.3"
1616
},
1717
"devDependencies": {
18-
"@epic-web/mcp-dev": "*",
19-
"tsx": "^4.19.3",
2018
"@epic-web/config": "^1.19.0",
19+
"@epic-web/mcp-dev": "*",
20+
"@faker-js/faker": "^9.8.0",
2121
"@kentcdodds/tmp-modelcontextprotocol_inspector": "^0.12.0-alpha.4",
2222
"@types/node": "^22.15.2",
23+
"tsx": "^4.19.3",
2324
"typescript": "^5.8.3",
2425
"vitest": "^3.1.2"
2526
},

exercises/01.ping/01.solution.connect/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@
1515
"zod": "^3.24.3"
1616
},
1717
"devDependencies": {
18-
"@epic-web/mcp-dev": "*",
19-
"tsx": "^4.19.3",
2018
"@epic-web/config": "^1.19.0",
19+
"@epic-web/mcp-dev": "*",
20+
"@faker-js/faker": "^9.8.0",
2121
"@kentcdodds/tmp-modelcontextprotocol_inspector": "^0.12.0-alpha.4",
2222
"@types/node": "^22.15.2",
23+
"tsx": "^4.19.3",
2324
"typescript": "^5.8.3",
2425
"vitest": "^3.1.2"
2526
},

exercises/02.tools/01.problem.simple/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@
1515
"zod": "^3.24.3"
1616
},
1717
"devDependencies": {
18-
"@epic-web/mcp-dev": "*",
19-
"tsx": "^4.19.3",
2018
"@epic-web/config": "^1.19.0",
19+
"@epic-web/mcp-dev": "*",
20+
"@faker-js/faker": "^9.8.0",
2121
"@kentcdodds/tmp-modelcontextprotocol_inspector": "^0.12.0-alpha.4",
2222
"@types/node": "^22.15.2",
23+
"tsx": "^4.19.3",
2324
"typescript": "^5.8.3",
2425
"vitest": "^3.1.2"
2526
},

exercises/02.tools/01.solution.simple/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@
1515
"zod": "^3.24.3"
1616
},
1717
"devDependencies": {
18-
"@epic-web/mcp-dev": "*",
19-
"tsx": "^4.19.3",
2018
"@epic-web/config": "^1.19.0",
19+
"@epic-web/mcp-dev": "*",
20+
"@faker-js/faker": "^9.8.0",
2121
"@kentcdodds/tmp-modelcontextprotocol_inspector": "^0.12.0-alpha.4",
2222
"@types/node": "^22.15.2",
23+
"tsx": "^4.19.3",
2324
"typescript": "^5.8.3",
2425
"vitest": "^3.1.2"
2526
},

exercises/02.tools/02.problem.args/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@
1515
"zod": "^3.24.3"
1616
},
1717
"devDependencies": {
18-
"@epic-web/mcp-dev": "*",
19-
"tsx": "^4.19.3",
2018
"@epic-web/config": "^1.19.0",
19+
"@epic-web/mcp-dev": "*",
20+
"@faker-js/faker": "^9.8.0",
2121
"@kentcdodds/tmp-modelcontextprotocol_inspector": "^0.12.0-alpha.4",
2222
"@types/node": "^22.15.2",
23+
"tsx": "^4.19.3",
2324
"typescript": "^5.8.3",
2425
"vitest": "^3.1.2"
2526
},

exercises/02.tools/02.solution.args/README.mdx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,3 @@ Key learnings from this step:
2727
- How to return dynamic results based on user input
2828

2929
You're now ready to build all sorts of powerful, parameterized tools!
30-
31-
🧝‍♀️ In the next exercise, we're going to be working with a more real-world
32-
application, so I'm going to be adding a database and things. You'll have to
33-
integrate that, but if you've got a minute, you
34-
can <NextDiffLink>check out my changes</NextDiffLink> if you're curious.

exercises/02.tools/02.solution.args/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@
1515
"zod": "^3.24.3"
1616
},
1717
"devDependencies": {
18-
"@epic-web/mcp-dev": "*",
19-
"tsx": "^4.19.3",
2018
"@epic-web/config": "^1.19.0",
19+
"@epic-web/mcp-dev": "*",
20+
"@faker-js/faker": "^9.8.0",
2121
"@kentcdodds/tmp-modelcontextprotocol_inspector": "^0.12.0-alpha.4",
2222
"@types/node": "^22.15.2",
23+
"tsx": "^4.19.3",
2324
"typescript": "^5.8.3",
2425
"vitest": "^3.1.2"
2526
},

exercises/02.tools/03.problem.errors/README.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ Example error response:
2626
Luckily for us, the MCP TypeScript SDK handles errors automatically. So all you
2727
need to do is throw an error from your tool, and the SDK will handle the rest!
2828

29-
For this step, we're going to say that tag names cannot include the word
30-
"error". If it does, throw an error with a descriptive message and then try it
31-
out in the inspector. You'll notice the `isError` field is set to `true` and the
32-
content is the helpful error message you provided.
29+
For this step, we're going to say that the second number cannot be negative. If
30+
it is, throw an error with a descriptive message and then try it out in the
31+
inspector. You'll notice the `isError` field is set to `true` and the content is
32+
the helpful error message you provided.
3333

3434
- [📜 MCP Spec: Errors](https://modelcontextprotocol.io/specification/2025-03-26/server/tools#error-handling)

exercises/02.tools/03.problem.errors/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@
1515
"zod": "^3.24.3"
1616
},
1717
"devDependencies": {
18-
"@epic-web/mcp-dev": "*",
19-
"tsx": "^4.19.3",
2018
"@epic-web/config": "^1.19.0",
19+
"@epic-web/mcp-dev": "*",
20+
"@faker-js/faker": "^9.8.0",
2121
"@kentcdodds/tmp-modelcontextprotocol_inspector": "^0.12.0-alpha.4",
2222
"@types/node": "^22.15.2",
23+
"tsx": "^4.19.3",
2324
"typescript": "^5.8.3",
2425
"vitest": "^3.1.2"
2526
},

0 commit comments

Comments
 (0)