naftiko: 1.0.0-alpha2 info: label: TD Ameritrade Accounts and Trading API — Orders description: 'TD Ameritrade Accounts and Trading API — Orders. 6 operations. Lead operation: Get Orders By Account. Self-contained Naftiko capability covering one Td Ameritrade Holding business surface.' tags: - Td Ameritrade Holding - Orders created: '2026-05-19' modified: '2026-05-19' binds: - namespace: env keys: TD_AMERITRADE_HOLDING_API_KEY: TD_AMERITRADE_HOLDING_API_KEY capability: consumes: - type: http namespace: td-ameritrade-accounts-trading-orders baseUri: https://api.tdameritrade.com/v1 description: TD Ameritrade Accounts and Trading API — Orders business capability. Self-contained, no shared references. resources: - name: accounts-accountId-orders path: /accounts/{accountId}/orders operations: - name: getordersbypath method: GET description: Get Orders By Account outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: maxResults in: query type: integer description: Maximum number of orders to return - name: fromEnteredTime in: query type: string description: Start date/time filter (yyyy-MM-dd format) - name: toEnteredTime in: query type: string description: End date/time filter (yyyy-MM-dd format) - name: status in: query type: string description: Filter by order status - name: placeorder method: POST description: Place Order outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: accounts-accountId-orders-orderId path: /accounts/{accountId}/orders/{orderId} operations: - name: getorder method: GET description: Get Order outputRawFormat: json outputParameters: - name: result type: object value: $. - name: replaceorder method: PUT description: Replace Order outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: cancelorder method: DELETE description: Cancel Order outputRawFormat: json outputParameters: - name: result type: object value: $. - name: orders path: /orders operations: - name: getordersbyquery method: GET description: Get All Orders outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: maxResults in: query type: integer description: Maximum number of orders to return - name: fromEnteredTime in: query type: string description: Start date filter (yyyy-MM-dd) - name: toEnteredTime in: query type: string description: End date filter (yyyy-MM-dd) - name: status in: query type: string description: Filter by order status authentication: type: bearer token: '{{env.TD_AMERITRADE_HOLDING_API_KEY}}' exposes: - type: rest namespace: td-ameritrade-accounts-trading-orders-rest port: 8080 description: REST adapter for TD Ameritrade Accounts and Trading API — Orders. One Spectral-compliant resource per consumed operation, prefixed with /v1. resources: - path: /v1/accounts/{accountid}/orders name: accounts-accountid-orders description: REST surface for accounts-accountId-orders. operations: - method: GET name: getordersbypath description: Get Orders By Account call: td-ameritrade-accounts-trading-orders.getordersbypath with: maxResults: rest.maxResults fromEnteredTime: rest.fromEnteredTime toEnteredTime: rest.toEnteredTime status: rest.status outputParameters: - type: object mapping: $. - method: POST name: placeorder description: Place Order call: td-ameritrade-accounts-trading-orders.placeorder with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/accounts/{accountid}/orders/{orderid} name: accounts-accountid-orders-orderid description: REST surface for accounts-accountId-orders-orderId. operations: - method: GET name: getorder description: Get Order call: td-ameritrade-accounts-trading-orders.getorder outputParameters: - type: object mapping: $. - method: PUT name: replaceorder description: Replace Order call: td-ameritrade-accounts-trading-orders.replaceorder with: body: rest.body outputParameters: - type: object mapping: $. - method: DELETE name: cancelorder description: Cancel Order call: td-ameritrade-accounts-trading-orders.cancelorder outputParameters: - type: object mapping: $. - path: /v1/orders name: orders description: REST surface for orders. operations: - method: GET name: getordersbyquery description: Get All Orders call: td-ameritrade-accounts-trading-orders.getordersbyquery with: maxResults: rest.maxResults fromEnteredTime: rest.fromEnteredTime toEnteredTime: rest.toEnteredTime status: rest.status outputParameters: - type: object mapping: $. - type: mcp namespace: td-ameritrade-accounts-trading-orders-mcp port: 9090 transport: http description: MCP adapter for TD Ameritrade Accounts and Trading API — Orders. One tool per consumed operation, routed inline through this capability's consumes block. tools: - name: get-orders-account description: Get Orders By Account hints: readOnly: true destructive: false idempotent: true call: td-ameritrade-accounts-trading-orders.getordersbypath with: maxResults: tools.maxResults fromEnteredTime: tools.fromEnteredTime toEnteredTime: tools.toEnteredTime status: tools.status outputParameters: - type: object mapping: $. - name: place-order description: Place Order hints: readOnly: false destructive: false idempotent: false call: td-ameritrade-accounts-trading-orders.placeorder with: body: tools.body outputParameters: - type: object mapping: $. - name: get-order description: Get Order hints: readOnly: true destructive: false idempotent: true call: td-ameritrade-accounts-trading-orders.getorder outputParameters: - type: object mapping: $. - name: replace-order description: Replace Order hints: readOnly: false destructive: false idempotent: true call: td-ameritrade-accounts-trading-orders.replaceorder with: body: tools.body outputParameters: - type: object mapping: $. - name: cancel-order description: Cancel Order hints: readOnly: false destructive: true idempotent: true call: td-ameritrade-accounts-trading-orders.cancelorder outputParameters: - type: object mapping: $. - name: get-all-orders description: Get All Orders hints: readOnly: true destructive: false idempotent: true call: td-ameritrade-accounts-trading-orders.getordersbyquery with: maxResults: tools.maxResults fromEnteredTime: tools.fromEnteredTime toEnteredTime: tools.toEnteredTime status: tools.status outputParameters: - type: object mapping: $.