Alpaca · Capability

Broker API — Documents

Broker API — Documents. 3 operations. Lead operation: Return a list of account documents.. Self-contained Naftiko capability covering one Alpaca business surface.

Run with Naftiko AlpacaDocuments

What You Can Do

GET
Getdocsforaccount — Return a list of account documents.
/v1/v1/accounts/{account-id}/documents
GET
Downloaddocfromaccount — Download a document file that belongs to an account.
/v1/v1/accounts/{account-id}/documents/{document-id}/download
GET
Downloaddocumentbyid — Download a document file directly
/v1/v1/documents/{document-id}

MCP Tools

return-list-account-documents

Return a list of account documents.

read-only idempotent
download-document-file-that-belongs

Download a document file that belongs to an account.

read-only idempotent
download-document-file-directly

Download a document file directly

read-only idempotent

Capability Spec

broker-documents.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Broker API — Documents
  description: 'Broker API — Documents. 3 operations. Lead operation: Return a list of account documents.. Self-contained
    Naftiko capability covering one Alpaca business surface.'
  tags:
  - Alpaca
  - Documents
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    ALPACA_API_KEY: ALPACA_API_KEY
capability:
  consumes:
  - type: http
    namespace: broker-documents
    baseUri: https://broker-api.sandbox.alpaca.markets
    description: Broker API — Documents business capability. Self-contained, no shared references.
    resources:
    - name: v1-accounts-account_id-documents
      path: /v1/accounts/{account_id}/documents
      operations:
      - name: getdocsforaccount
        method: GET
        description: Return a list of account documents.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: start_date
          in: query
          type: string
          description: optional date value to filter the list (inclusive).
        - name: end_date
          in: query
          type: string
          description: optional date value to filter the list (inclusive).
    - name: v1-accounts-account_id-documents-document_id-download
      path: /v1/accounts/{account_id}/documents/{document_id}/download
      operations:
      - name: downloaddocfromaccount
        method: GET
        description: Download a document file that belongs to an account.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: v1-documents-document_id
      path: /v1/documents/{document_id}
      operations:
      - name: downloaddocumentbyid
        method: GET
        description: Download a document file directly
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    authentication:
      type: basic
      username: '{{env.ALPACA_USER}}'
      password: '{{env.ALPACA_PASS}}'
  exposes:
  - type: rest
    namespace: broker-documents-rest
    port: 8080
    description: REST adapter for Broker API — Documents. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/v1/accounts/{account-id}/documents
      name: v1-accounts-account-id-documents
      description: REST surface for v1-accounts-account_id-documents.
      operations:
      - method: GET
        name: getdocsforaccount
        description: Return a list of account documents.
        call: broker-documents.getdocsforaccount
        with:
          start_date: rest.start_date
          end_date: rest.end_date
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/v1/accounts/{account-id}/documents/{document-id}/download
      name: v1-accounts-account-id-documents-document-id-download
      description: REST surface for v1-accounts-account_id-documents-document_id-download.
      operations:
      - method: GET
        name: downloaddocfromaccount
        description: Download a document file that belongs to an account.
        call: broker-documents.downloaddocfromaccount
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/v1/documents/{document-id}
      name: v1-documents-document-id
      description: REST surface for v1-documents-document_id.
      operations:
      - method: GET
        name: downloaddocumentbyid
        description: Download a document file directly
        call: broker-documents.downloaddocumentbyid
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: broker-documents-mcp
    port: 9090
    transport: http
    description: MCP adapter for Broker API — Documents. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: return-list-account-documents
      description: Return a list of account documents.
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: broker-documents.getdocsforaccount
      with:
        start_date: tools.start_date
        end_date: tools.end_date
      outputParameters:
      - type: object
        mapping: $.
    - name: download-document-file-that-belongs
      description: Download a document file that belongs to an account.
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: broker-documents.downloaddocfromaccount
      outputParameters:
      - type: object
        mapping: $.
    - name: download-document-file-directly
      description: Download a document file directly
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: broker-documents.downloaddocumentbyid
      outputParameters:
      - type: object
        mapping: $.