Spaces:
Sleeping
Sleeping
Update server.py
Browse files
server.py
CHANGED
@@ -4,6 +4,8 @@ import string
|
|
4 |
|
5 |
from fastmcp import FastMCP
|
6 |
from pydantic import BaseModel
|
|
|
|
|
7 |
|
8 |
# Create an MCP server
|
9 |
mcp = FastMCP("Airline Agent")
|
@@ -87,6 +89,9 @@ flight_database = {
|
|
87 |
itinery_database = {}
|
88 |
ticket_database = {}
|
89 |
|
|
|
|
|
|
|
90 |
|
91 |
@mcp.tool()
|
92 |
def fetch_flight_info(date: Date, origin: str, destination: str):
|
|
|
4 |
|
5 |
from fastmcp import FastMCP
|
6 |
from pydantic import BaseModel
|
7 |
+
from starlette.requests import Request
|
8 |
+
from starlette.responses import PlainTextResponse
|
9 |
|
10 |
# Create an MCP server
|
11 |
mcp = FastMCP("Airline Agent")
|
|
|
89 |
itinery_database = {}
|
90 |
ticket_database = {}
|
91 |
|
92 |
+
@mcp.custom_route("/health", methods=["GET"])
|
93 |
+
async def health_check(request: Request) -> PlainTextResponse:
|
94 |
+
return PlainTextResponse("OK")
|
95 |
|
96 |
@mcp.tool()
|
97 |
def fetch_flight_info(date: Date, origin: str, destination: str):
|