Skip to content

Commit 2b3aa45

Browse files
committed
add bank_id to consent_error response
1 parent 64f4df3 commit 2b3aa45

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/mcp_server_obp/server.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,13 +263,15 @@ async def call_obp_api(
263263
case "consent":
264264
consent_jwt = (headers or {}).get("Consent-JWT")
265265
if not consent_jwt:
266+
bank_id = (path_params or {}).get("BANK_ID") or (path_params or {}).get("bank_id")
266267
return json.dumps({
267268
"error": "consent_required",
268269
"endpoint_id": endpoint_id,
269270
"operation_id": endpoint.operation_id,
270271
"method": endpoint.method,
271272
"path": endpoint.path,
272273
"required_roles": [role.model_dump() for role in endpoint.roles],
274+
"bank_id": bank_id,
273275
"message": f"User consent is required to call {endpoint.operation_id}. "
274276
f"Please approve and provide a Consent-JWT.",
275277
}, indent=2)

0 commit comments

Comments
 (0)