start_consent
Initiates an Open Finance Brasil consent flow by creating a consent resource and returning a bank authorization URL the user must open to approve data-sharing scopes.
Instructions
Starts the Open Finance Brasil consent flow for a user at a bank.
Creates a consent resource at the bank, then builds a FAPI-BR
compliant (PAR + JAR) authorization URL. The user must open this
URL in a browser, log in, and authorize the requested scopes at
the bank. Once redirected back, call complete_consent with the
resulting URL to finish the flow.
Args: subject_id: User's CPF (digits only) or internal ID. bank: Identifier of the participating bank. scopes: Desired data-sharing scopes, e.g. ['accounts', 'balances', 'transactions', 'overdraft_limits', 'credit_card_accounts', 'credit_card_limits', 'credit_card_bills', 'credit_card_transactions', 'bank_fixed_incomes', 'funds', 'variable_incomes', 'treasure_titles']. Does NOT include 'pix'/payments - payment initiation uses a separate, dedicated payment consent (Payments API), not this data-sharing consent; see tools/pix.py. ctx: MCP request context, providing access to shared dependencies. request_url_elicitation: Ask a compatible MCP client to open the bank authorization URL using URL-mode elicitation. The URL is always returned as well, so clients without elicitation support can continue with the existing copy-and-open flow.
Returns: The consent ID and the URL the user must open to authorize it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bank | Yes | ||
| scopes | Yes | ||
| subject_id | Yes | ||
| request_url_elicitation | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bank | Yes | ||
| consent_id | Yes | ||
| authorization_url | Yes | ||
| expires_in_minutes | Yes |