We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 875eb65 + b02e823 commit 0bf4a28Copy full SHA for 0bf4a28
03-GettingStarted/01-first-server/solution/python/server.py
@@ -10,14 +10,18 @@
10
def add(a: int, b: int) -> int:
11
"""Add two numbers"""
12
return a + b
13
-
+@mcp.tool()
14
+def subtract(a: int, b: int) -> int:
15
+ """Subtract two numbers"""
16
+ return a - b
17
18
# Add a dynamic greeting resource
19
@mcp.resource("greeting://{name}")
20
def get_greeting(name: str) -> str:
21
"""Get a personalized greeting"""
22
return f"Hello, {name}!"
23
24
+
25
# Main execution block - this is required to run the server
26
if __name__ == "__main__":
27
mcp.run()
0 commit comments