File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1010
1111from fastmcp import FastMCP
1212from fastmcp .tools .tool import ToolResult
13+ from starlette .requests import Request
14+ from starlette .responses import PlainTextResponse
1315from pydantic import BaseModel , Field
1416
1517from ..chunking import ChunkingConfig
@@ -390,6 +392,25 @@ def create_mcp_server() -> FastMCP:
390392 # Create FastMCP server directly
391393 app = FastMCP ("maestro-vector-db" )
392394
395+ @app .custom_route ("/health" , methods = ["GET" ])
396+ async def health_check (request : Request ) -> PlainTextResponse :
397+ if not vector_databases :
398+ PlainTextResponse ("No vector databases are currently active" )
399+
400+ db_list = []
401+ for db_name , db in vector_databases .items ():
402+ db_list .append (
403+ {
404+ "name" : db_name ,
405+ "type" : db .db_type ,
406+ "collection" : db .collection_name ,
407+ "document_count" : db .count_documents (),
408+ }
409+ )
410+ return PlainTextResponse (
411+ f"Available vector databases:\n { json .dumps (db_list , indent = 2 )} "
412+ )
413+
393414 @app .tool ()
394415 async def create_vector_database_tool (input : CreateVectorDatabaseInput ) -> str :
395416 """Create a new vector database instance."""
You can’t perform that action at this time.
0 commit comments