CFPB Consumer Complaint Database API — Search

CFPB Consumer Complaint Database API — Search. 3 operations. Lead operation: Search complaints. Self-contained Naftiko capability covering one Consumer Financial Protection Bureau business surface.

Run with Naftiko Consumer Financial Protection BureauSearch

What You Can Do

GET
Searchcomplaints — Search complaints
/v1
GET
Getsuggestions — Autocomplete suggestions
/v1/suggest
GET
Getcomplaint — Get a single complaint by ID
/v1/{complaintid}

MCP Tools

search-complaints

Search complaints

read-only idempotent
autocomplete-suggestions

Autocomplete suggestions

read-only idempotent
get-single-complaint-id

Get a single complaint by ID

read-only idempotent

Capability Spec

cfpb-ccdb-search.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: CFPB Consumer Complaint Database API — Search
  description: 'CFPB Consumer Complaint Database API — Search. 3 operations. Lead operation: Search complaints. Self-contained
    Naftiko capability covering one Consumer Financial Protection Bureau business surface.'
  tags:
  - Consumer Financial Protection Bureau
  - Search
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    CONSUMER_FINANCIAL_PROTECTION_BUREAU_API_KEY: CONSUMER_FINANCIAL_PROTECTION_BUREAU_API_KEY
capability:
  consumes:
  - type: http
    namespace: cfpb-ccdb-search
    baseUri: https://www.consumerfinance.gov/data-research/consumer-complaints/search/api/v1
    description: CFPB Consumer Complaint Database API — Search business capability. Self-contained, no shared references.
    resources:
    - name: root
      path: /
      operations:
      - name: searchcomplaints
        method: GET
        description: Search complaints
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: search_term
          in: query
          type: string
          description: Free-text search across complaint narratives.
        - name: field
          in: query
          type: string
        - name: frm
          in: query
          type: integer
          description: Result offset (0-based).
        - name: size
          in: query
          type: integer
        - name: sort
          in: query
          type: string
        - name: format
          in: query
          type: string
        - name: date_received_min
          in: query
          type: string
        - name: date_received_max
          in: query
          type: string
        - name: company
          in: query
          type: array
        - name: product
          in: query
          type: array
        - name: state
          in: query
          type: array
        - name: tags
          in: query
          type: array
    - name: suggest
      path: /suggest/
      operations:
      - name: getsuggestions
        method: GET
        description: Autocomplete suggestions
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: text
          in: query
          type: string
          required: true
        - name: size
          in: query
          type: integer
    - name: complaintId
      path: /{complaintId}/
      operations:
      - name: getcomplaint
        method: GET
        description: Get a single complaint by ID
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: complaintId
          in: path
          type: string
          required: true
  exposes:
  - type: rest
    namespace: cfpb-ccdb-search-rest
    port: 8080
    description: REST adapter for CFPB Consumer Complaint Database API — Search. One Spectral-compliant resource per consumed
      operation, prefixed with /v1.
    resources:
    - path: /v1
      name: root
      description: REST surface for root.
      operations:
      - method: GET
        name: searchcomplaints
        description: Search complaints
        call: cfpb-ccdb-search.searchcomplaints
        with:
          search_term: rest.search_term
          field: rest.field
          frm: rest.frm
          size: rest.size
          sort: rest.sort
          format: rest.format
          date_received_min: rest.date_received_min
          date_received_max: rest.date_received_max
          company: rest.company
          product: rest.product
          state: rest.state
          tags: rest.tags
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/suggest
      name: suggest
      description: REST surface for suggest.
      operations:
      - method: GET
        name: getsuggestions
        description: Autocomplete suggestions
        call: cfpb-ccdb-search.getsuggestions
        with:
          text: rest.text
          size: rest.size
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/{complaintid}
      name: complaintid
      description: REST surface for complaintId.
      operations:
      - method: GET
        name: getcomplaint
        description: Get a single complaint by ID
        call: cfpb-ccdb-search.getcomplaint
        with:
          complaintId: rest.complaintId
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: cfpb-ccdb-search-mcp
    port: 9090
    transport: http
    description: MCP adapter for CFPB Consumer Complaint Database API — Search. One tool per consumed operation, routed inline
      through this capability's consumes block.
    tools:
    - name: search-complaints
      description: Search complaints
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: cfpb-ccdb-search.searchcomplaints
      with:
        search_term: tools.search_term
        field: tools.field
        frm: tools.frm
        size: tools.size
        sort: tools.sort
        format: tools.format
        date_received_min: tools.date_received_min
        date_received_max: tools.date_received_max
        company: tools.company
        product: tools.product
        state: tools.state
        tags: tools.tags
      outputParameters:
      - type: object
        mapping: $.
    - name: autocomplete-suggestions
      description: Autocomplete suggestions
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: cfpb-ccdb-search.getsuggestions
      with:
        text: tools.text
        size: tools.size
      outputParameters:
      - type: object
        mapping: $.
    - name: get-single-complaint-id
      description: Get a single complaint by ID
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: cfpb-ccdb-search.getcomplaint
      with:
        complaintId: tools.complaintId
      outputParameters:
      - type: object
        mapping: $.