How to rerun the same US stock bar query from an AI session in a script
TickDB Research ·
How to rerun the same US stock bar query from an AI session in a script
Save the request before passing historical stock data from an AI session to a script. TickDB MCP and CLI 0.2.1 returned five AAPL daily bars with identical timestamps and OHLCV values in this test. Here are the fixed inputs, command and failure checks.
A colleague sends you a table of five AAPL daily bars from an AI session. A few days later, fetching “the last five” gives you a different window. To reproduce the original analysis, keep the symbol, interval, exact date bounds and adjustment mode next to the table.
Pin the request
This test used AAPL.US, stock, daily bars, no adjustment, and a limit of 10. The window runs from midnight October 26 to 23:59:59 on October 30, 2026 in New York. Convert the timezone-aware bounds to Unix milliseconds for both clients.
{"symbol":"AAPL.US","type":"stock","interval":"1d","adjust":"none",
"start_time":1792987200000,"end_time":1793419199000,"limit":10}
Run the request with the MCP get_kline tool and save its inputs and raw JSON. With credentials already configured, run the matching TickDB CLI 0.2.1 command. TickDB AI Market Data Tools
tickdb kline AAPL.US --type stock --interval 1d --adjust none --from 1792987200000 --to 1793419199000 --limit 10 --json
Compare row keys and values

Both responses carried business code 0. The timestamp and the open, high, low, close and volume matched across all five rows. Here are the closes for a quick check. Use decimal values for comparison so formatting changes do not create false mismatches.
| New York trading date | MCP close (USD) | CLI close (USD) |
|---|---|---|
| Oct 26 | 343.91 | 343.91 |
| Oct 27 | 347.10 | 347.10 |
| Oct 28 | 343.83 | 343.83 |
| Oct 29 | 348.91 | 348.91 |
| Oct 30 | 344.63 | 344.63 |
This test verifies reproducibility for one request across two clients of the same service. Repeat the check with your actual symbol, permissions and dates. A successful query can return fewer sessions than expected, so compare the timestamps against the expected trading dates as well.
Preserve the failure path
Changing the interval to 2d in the CLI triggered a validation error and exit code 1. Have your script check the exit code before parsing the business response. Then verify the returned symbol and interval, unique timestamps, expected trading dates and values. Keep both raw responses when a check fails.
Frequently asked questions
Can I use the latest five bars? That will move the window on a later run. Pin both bounds and use completed periods to reproduce an earlier result.
Should I drop fields I don't use? Keep the original response in your internal evidence. You can export only the closing prices you need while keeping the other inputs available to review.
References
- TickDB AI Market Data Tools and official CLI 0.2.1 command help.
- TickDB Docs, K-line query. Results from two actual AAPL.US requests and the CLI invalid-interval test.
This week’s offer

November 23–29, 2026, through 23:59 Beijing time. Save 15% on six months and get an extra half month, or save 20% on a year and get an extra month. Eligible for new paid subscriptions and renewals.
Category coverage
- US stocks
- 14,809