naftiko: 1.0.0-alpha2 info: label: Broker API — Accounts description: 'Broker API — Accounts. 19 operations. Lead operation: Get all accounts. Self-contained Naftiko capability covering one Alpaca business surface.' tags: - Alpaca - Accounts created: '2026-05-19' modified: '2026-05-19' binds: - namespace: env keys: ALPACA_API_KEY: ALPACA_API_KEY capability: consumes: - type: http namespace: broker-accounts baseUri: https://broker-api.sandbox.alpaca.markets description: Broker API — Accounts business capability. Self-contained, no shared references. resources: - name: v1-accounts path: /v1/accounts operations: - name: getallaccounts method: GET description: Get all accounts outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: query in: query type: string description: Pass space-delimited tokens. The response will contain accounts that match with each of the tokens (logical AND). A match means the token is present in either t - name: created_after in: query type: string - name: created_before in: query type: string - name: status in: query type: string description: See the AccountStatus model for values - name: entities in: query type: string description: Comma-delimited entity names to include in the response - name: createaccount method: POST description: Create an account outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: v1-accounts-activities path: /v1/accounts/activities operations: - name: getaccountactivities method: GET description: Retrieve account activities outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: account_id in: query type: string description: id of a single account to filter by - name: date in: query type: string description: Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ supported. - name: until in: query type: string description: Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ supported. - name: after in: query type: string description: Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ supported. Cannot be used with date. - name: page_size in: query type: integer description: The maximum number of entries to return in the response - name: page_token in: query type: string description: The Activity ID of the end of your current page of results. - name: v1-accounts-activities-activity_type path: /v1/accounts/activities/{activity_type} operations: - name: getaccountactivitiesbytype method: GET description: Retrieve specific account activities outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: account_id in: query type: string description: id of a single account to filter by - name: date in: query type: string description: Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ supported. - name: until in: query type: string description: Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ supported. - name: after in: query type: string description: Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ supported. - name: page_size in: query type: integer description: The maximum number of entries to return in the response - name: page_token in: query type: string description: The ID of the end of your current page of results - name: v1-accounts-account_id path: /v1/accounts/{account_id} operations: - name: getaccount method: GET description: Get an account by Id. outputRawFormat: json outputParameters: - name: result type: object value: $. - name: patchaccount method: PATCH description: Update an account outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: deleteaccount method: DELETE description: Request to close an account outputRawFormat: json outputParameters: - name: result type: object value: $. - name: v1-accounts-account_id-ach_relationships path: /v1/accounts/{account_id}/ach_relationships operations: - name: getaccountachrelationships method: GET description: Retrieve ACH Relationships for an account outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: statuses in: query type: string description: Comma-separated status values - name: createachrelationshipforaccount method: POST description: Create an ACH Relationship outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: v1-accounts-account_id-ach_relationships-ach_relationship_id path: /v1/accounts/{account_id}/ach_relationships/{ach_relationship_id} operations: - name: deleteachrelationshipfromaccount method: DELETE description: Delete an existing ACH relationship outputRawFormat: json outputParameters: - name: result type: object value: $. - name: v1-accounts-account_id-documents-upload path: /v1/accounts/{account_id}/documents/upload operations: - name: uploaddoctoaccount method: POST description: Upload a document to an already existing account outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: v1-accounts-account_id-recipient_banks path: /v1/accounts/{account_id}/recipient_banks operations: - name: getrecipientbanks method: GET description: Retrieve bank relationships for an account outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: status in: query type: string - name: bank_name in: query type: string - name: createrecipientbank method: POST description: Create a Bank Relationship for an account outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: v1-accounts-account_id-recipient_banks-bank_id path: /v1/accounts/{account_id}/recipient_banks/{bank_id} operations: - name: deleterecipientbank method: DELETE description: Delete a Bank Relationship for an account outputRawFormat: json outputParameters: - name: result type: object value: $. - name: v1-accounts-account_id-transfers path: /v1/accounts/{account_id}/transfers operations: - name: gettransfersforaccount method: GET description: Return a list of transfers for an account. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: direction in: query type: string description: INCOMING or OUTGOING - name: limit in: query type: integer - name: offset in: query type: integer - name: createtransferforaccount method: POST description: Request a new transfer outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: account_id in: path type: string required: true - name: body in: body type: object description: Request body (JSON). required: true - name: v1-accounts-account_id-transfers-transfer_id path: /v1/accounts/{account_id}/transfers/{transfer_id} operations: - name: deletetransfer method: DELETE description: Request to close a transfer outputRawFormat: json outputParameters: - name: result type: object value: $. - name: v1-events-accounts-status path: /v1/events/accounts/status operations: - name: suscribetoaccountstatussse method: GET description: Subscribe to account status events (SSE). outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: since in: query type: string description: 'Format: YYYY-MM-DD' - name: until in: query type: string description: 'Format: YYYY-MM-DD' - name: since_id in: query type: integer - name: until_id in: query type: integer - name: v1-trading-accounts-account_id-account path: /v1/trading/accounts/{account_id}/account operations: - name: gettradingaccount method: GET description: Retrieve trading details for an account. outputRawFormat: json outputParameters: - name: result type: object value: $. authentication: type: basic username: '{{env.ALPACA_USER}}' password: '{{env.ALPACA_PASS}}' exposes: - type: rest namespace: broker-accounts-rest port: 8080 description: REST adapter for Broker API — Accounts. One Spectral-compliant resource per consumed operation, prefixed with /v1. resources: - path: /v1/v1/accounts name: v1-accounts description: REST surface for v1-accounts. operations: - method: GET name: getallaccounts description: Get all accounts call: broker-accounts.getallaccounts with: query: rest.query created_after: rest.created_after created_before: rest.created_before status: rest.status entities: rest.entities outputParameters: - type: object mapping: $. - method: POST name: createaccount description: Create an account call: broker-accounts.createaccount with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/v1/accounts/activities name: v1-accounts-activities description: REST surface for v1-accounts-activities. operations: - method: GET name: getaccountactivities description: Retrieve account activities call: broker-accounts.getaccountactivities with: account_id: rest.account_id date: rest.date until: rest.until after: rest.after page_size: rest.page_size page_token: rest.page_token outputParameters: - type: object mapping: $. - path: /v1/v1/accounts/activities/{activity-type} name: v1-accounts-activities-activity-type description: REST surface for v1-accounts-activities-activity_type. operations: - method: GET name: getaccountactivitiesbytype description: Retrieve specific account activities call: broker-accounts.getaccountactivitiesbytype with: account_id: rest.account_id date: rest.date until: rest.until after: rest.after page_size: rest.page_size page_token: rest.page_token outputParameters: - type: object mapping: $. - path: /v1/v1/accounts/{account-id} name: v1-accounts-account-id description: REST surface for v1-accounts-account_id. operations: - method: GET name: getaccount description: Get an account by Id. call: broker-accounts.getaccount outputParameters: - type: object mapping: $. - method: PATCH name: patchaccount description: Update an account call: broker-accounts.patchaccount with: body: rest.body outputParameters: - type: object mapping: $. - method: DELETE name: deleteaccount description: Request to close an account call: broker-accounts.deleteaccount outputParameters: - type: object mapping: $. - path: /v1/v1/accounts/{account-id}/ach-relationships name: v1-accounts-account-id-ach-relationships description: REST surface for v1-accounts-account_id-ach_relationships. operations: - method: GET name: getaccountachrelationships description: Retrieve ACH Relationships for an account call: broker-accounts.getaccountachrelationships with: statuses: rest.statuses outputParameters: - type: object mapping: $. - method: POST name: createachrelationshipforaccount description: Create an ACH Relationship call: broker-accounts.createachrelationshipforaccount with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/v1/accounts/{account-id}/ach-relationships/{ach-relationship-id} name: v1-accounts-account-id-ach-relationships-ach-relationship-id description: REST surface for v1-accounts-account_id-ach_relationships-ach_relationship_id. operations: - method: DELETE name: deleteachrelationshipfromaccount description: Delete an existing ACH relationship call: broker-accounts.deleteachrelationshipfromaccount outputParameters: - type: object mapping: $. - path: /v1/v1/accounts/{account-id}/documents/upload name: v1-accounts-account-id-documents-upload description: REST surface for v1-accounts-account_id-documents-upload. operations: - method: POST name: uploaddoctoaccount description: Upload a document to an already existing account call: broker-accounts.uploaddoctoaccount with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/v1/accounts/{account-id}/recipient-banks name: v1-accounts-account-id-recipient-banks description: REST surface for v1-accounts-account_id-recipient_banks. operations: - method: GET name: getrecipientbanks description: Retrieve bank relationships for an account call: broker-accounts.getrecipientbanks with: status: rest.status bank_name: rest.bank_name outputParameters: - type: object mapping: $. - method: POST name: createrecipientbank description: Create a Bank Relationship for an account call: broker-accounts.createrecipientbank with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/v1/accounts/{account-id}/recipient-banks/{bank-id} name: v1-accounts-account-id-recipient-banks-bank-id description: REST surface for v1-accounts-account_id-recipient_banks-bank_id. operations: - method: DELETE name: deleterecipientbank description: Delete a Bank Relationship for an account call: broker-accounts.deleterecipientbank outputParameters: - type: object mapping: $. - path: /v1/v1/accounts/{account-id}/transfers name: v1-accounts-account-id-transfers description: REST surface for v1-accounts-account_id-transfers. operations: - method: GET name: gettransfersforaccount description: Return a list of transfers for an account. call: broker-accounts.gettransfersforaccount with: direction: rest.direction limit: rest.limit offset: rest.offset outputParameters: - type: object mapping: $. - method: POST name: createtransferforaccount description: Request a new transfer call: broker-accounts.createtransferforaccount with: account_id: rest.account_id body: rest.body outputParameters: - type: object mapping: $. - path: /v1/v1/accounts/{account-id}/transfers/{transfer-id} name: v1-accounts-account-id-transfers-transfer-id description: REST surface for v1-accounts-account_id-transfers-transfer_id. operations: - method: DELETE name: deletetransfer description: Request to close a transfer call: broker-accounts.deletetransfer outputParameters: - type: object mapping: $. - path: /v1/v1/events/accounts/status name: v1-events-accounts-status description: REST surface for v1-events-accounts-status. operations: - method: GET name: suscribetoaccountstatussse description: Subscribe to account status events (SSE). call: broker-accounts.suscribetoaccountstatussse with: since: rest.since until: rest.until since_id: rest.since_id until_id: rest.until_id outputParameters: - type: object mapping: $. - path: /v1/v1/trading/accounts/{account-id}/account name: v1-trading-accounts-account-id-account description: REST surface for v1-trading-accounts-account_id-account. operations: - method: GET name: gettradingaccount description: Retrieve trading details for an account. call: broker-accounts.gettradingaccount outputParameters: - type: object mapping: $. - type: mcp namespace: broker-accounts-mcp port: 9090 transport: http description: MCP adapter for Broker API — Accounts. One tool per consumed operation, routed inline through this capability's consumes block. tools: - name: get-all-accounts description: Get all accounts hints: readOnly: true destructive: false idempotent: true call: broker-accounts.getallaccounts with: query: tools.query created_after: tools.created_after created_before: tools.created_before status: tools.status entities: tools.entities outputParameters: - type: object mapping: $. - name: create-account description: Create an account hints: readOnly: false destructive: false idempotent: false call: broker-accounts.createaccount with: body: tools.body outputParameters: - type: object mapping: $. - name: retrieve-account-activities description: Retrieve account activities hints: readOnly: true destructive: false idempotent: true call: broker-accounts.getaccountactivities with: account_id: tools.account_id date: tools.date until: tools.until after: tools.after page_size: tools.page_size page_token: tools.page_token outputParameters: - type: object mapping: $. - name: retrieve-specific-account-activities description: Retrieve specific account activities hints: readOnly: true destructive: false idempotent: true call: broker-accounts.getaccountactivitiesbytype with: account_id: tools.account_id date: tools.date until: tools.until after: tools.after page_size: tools.page_size page_token: tools.page_token outputParameters: - type: object mapping: $. - name: get-account-id description: Get an account by Id. hints: readOnly: true destructive: false idempotent: true call: broker-accounts.getaccount outputParameters: - type: object mapping: $. - name: update-account description: Update an account hints: readOnly: false destructive: false idempotent: true call: broker-accounts.patchaccount with: body: tools.body outputParameters: - type: object mapping: $. - name: request-close-account description: Request to close an account hints: readOnly: false destructive: true idempotent: true call: broker-accounts.deleteaccount outputParameters: - type: object mapping: $. - name: retrieve-ach-relationships-account description: Retrieve ACH Relationships for an account hints: readOnly: true destructive: false idempotent: true call: broker-accounts.getaccountachrelationships with: statuses: tools.statuses outputParameters: - type: object mapping: $. - name: create-ach-relationship description: Create an ACH Relationship hints: readOnly: false destructive: false idempotent: false call: broker-accounts.createachrelationshipforaccount with: body: tools.body outputParameters: - type: object mapping: $. - name: delete-existing-ach-relationship description: Delete an existing ACH relationship hints: readOnly: false destructive: true idempotent: true call: broker-accounts.deleteachrelationshipfromaccount outputParameters: - type: object mapping: $. - name: upload-document-already-existing-account description: Upload a document to an already existing account hints: readOnly: false destructive: false idempotent: false call: broker-accounts.uploaddoctoaccount with: body: tools.body outputParameters: - type: object mapping: $. - name: retrieve-bank-relationships-account description: Retrieve bank relationships for an account hints: readOnly: true destructive: false idempotent: true call: broker-accounts.getrecipientbanks with: status: tools.status bank_name: tools.bank_name outputParameters: - type: object mapping: $. - name: create-bank-relationship-account description: Create a Bank Relationship for an account hints: readOnly: false destructive: false idempotent: false call: broker-accounts.createrecipientbank with: body: tools.body outputParameters: - type: object mapping: $. - name: delete-bank-relationship-account description: Delete a Bank Relationship for an account hints: readOnly: false destructive: true idempotent: true call: broker-accounts.deleterecipientbank outputParameters: - type: object mapping: $. - name: return-list-transfers-account description: Return a list of transfers for an account. hints: readOnly: true destructive: false idempotent: true call: broker-accounts.gettransfersforaccount with: direction: tools.direction limit: tools.limit offset: tools.offset outputParameters: - type: object mapping: $. - name: request-new-transfer description: Request a new transfer hints: readOnly: false destructive: false idempotent: false call: broker-accounts.createtransferforaccount with: account_id: tools.account_id body: tools.body outputParameters: - type: object mapping: $. - name: request-close-transfer description: Request to close a transfer hints: readOnly: false destructive: true idempotent: true call: broker-accounts.deletetransfer outputParameters: - type: object mapping: $. - name: subscribe-account-status-events-sse description: Subscribe to account status events (SSE). hints: readOnly: true destructive: false idempotent: true call: broker-accounts.suscribetoaccountstatussse with: since: tools.since until: tools.until since_id: tools.since_id until_id: tools.until_id outputParameters: - type: object mapping: $. - name: retrieve-trading-details-account description: Retrieve trading details for an account. hints: readOnly: true destructive: false idempotent: true call: broker-accounts.gettradingaccount outputParameters: - type: object mapping: $.