Skip to content

Commit d1105a5

Browse files
committed
style: ruff format server.py
1 parent 72dfef3 commit d1105a5

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

  • examples/servers/postgres-knowledge-server/mcp_postgres_server

examples/servers/postgres-knowledge-server/mcp_postgres_server/server.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,7 @@ async def handle_list_tools(
135135
return types.ListToolsResult(tools=TOOLS)
136136

137137

138-
async def handle_call_tool(
139-
ctx: ServerRequestContext, params: types.CallToolRequestParams
140-
) -> types.CallToolResult:
138+
async def handle_call_tool(ctx: ServerRequestContext, params: types.CallToolRequestParams) -> types.CallToolResult:
141139
args = params.arguments or {}
142140
app_id = args.get("app_id", "")
143141

@@ -163,8 +161,9 @@ async def handle_call_tool(
163161

164162
elif params.name == "knowledge_get":
165163
with conn.cursor(cursor_factory=psycopg2.extras.RealDictCursor) as cur:
166-
cur.execute("SELECT id, title, body, created FROM knowledge WHERE id=%s AND app_id=%s",
167-
(args["id"], app_id))
164+
cur.execute(
165+
"SELECT id, title, body, created FROM knowledge WHERE id=%s AND app_id=%s", (args["id"], app_id)
166+
)
168167
row = cur.fetchone()
169168
result = dict(row) if row else {"error": "not_found"}
170169

@@ -187,9 +186,7 @@ async def handle_call_tool(
187186
)
188187

189188
conn.close()
190-
return types.CallToolResult(
191-
content=[types.TextContent(type="text", text=json.dumps(result, default=str))]
192-
)
189+
return types.CallToolResult(content=[types.TextContent(type="text", text=json.dumps(result, default=str))])
193190

194191
except Exception as exc:
195192
return types.CallToolResult(
@@ -202,6 +199,7 @@ async def handle_call_tool(
202199
# Entry point
203200
# ---------------------------------------------------------------------------
204201

202+
205203
@click.command()
206204
def main():
207205
"""Postgres-backed MCP knowledge server (stdio transport)."""

0 commit comments

Comments
 (0)