File tree Expand file tree Collapse file tree
examples/servers/postgres-knowledge-server/mcp_postgres_server Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616import json
1717import os
1818from pathlib import Path
19+ from typing import Any
1920
2021import anyio
2122import click
@@ -60,7 +61,7 @@ def get_conn():
6061 return psycopg2 .connect (dbname = PG_DB , user = PG_USER )
6162
6263
63- def ensure_schema (conn ) :
64+ def ensure_schema (conn : Any ) -> None :
6465 with conn .cursor () as cur :
6566 cur .execute ("""
6667 CREATE TABLE IF NOT EXISTS knowledge (
@@ -142,7 +143,7 @@ async def handle_call_tool(ctx: ServerRequestContext, params: types.CallToolRequ
142143 if not authorized (app_id ):
143144 return types .CallToolResult (
144145 content = [types .TextContent (type = "text" , text = f"Unauthorized: no SAFE folder for '{ app_id } '" )],
145- isError = True ,
146+ is_error = True ,
146147 )
147148
148149 try :
@@ -182,7 +183,7 @@ async def handle_call_tool(ctx: ServerRequestContext, params: types.CallToolRequ
182183 else :
183184 return types .CallToolResult (
184185 content = [types .TextContent (type = "text" , text = f"Unknown tool: { params .name } " )],
185- isError = True ,
186+ is_error = True ,
186187 )
187188
188189 conn .close ()
@@ -191,7 +192,7 @@ async def handle_call_tool(ctx: ServerRequestContext, params: types.CallToolRequ
191192 except Exception as exc :
192193 return types .CallToolResult (
193194 content = [types .TextContent (type = "text" , text = f"Error: { exc } " )],
194- isError = True ,
195+ is_error = True ,
195196 )
196197
197198
You can’t perform that action at this time.
0 commit comments