Learn
Let an AI agent research Japanese stocks
Key points
- check_circleDon't rely on the model's memory for numbers. Have it fetch values taken from earnings summaries and annual securities reports through MCP tools.
- check_circleThere are 72 MCP tools. Each one maps to a single REST endpoint and costs the same number of tokens.
- check_circleHave the agent cite provenance and sourceUrl, and respect Retry-After on a 429. Exchange data must not be passed on to third parties.
Information as of 2026-10-20.
Why give the agent primary data
A large language model (LLM) doesn't know about results published after its training cutoff. Even the numbers it remembers may have the wrong fiscal period or unit.
Japanese equities follow conventions that differ from other markets: two-stage disclosure (the kessan tanshin earnings summary, then the audited annual securities report), March fiscal year-ends, and cumulative quarterly figures. An agent that doesn't know them produces plausible but wrong numbers.
So make the agent fetch every number with a tool and cite the document it came from. Let the model do what it is good at: organising and explaining the values it retrieved.
How the ZENITH Code MCP server works
MCP (Model Context Protocol) is a common way for AI clients to call external tools. For each tool, the ZENITH Code MCP server calls one REST endpoint under /stable and returns its response to the agent.
Authentication uses the same API key as the REST API. You can list the tools (tools/list) without a key; running a tool (tools/call) needs one.
Each tool call costs the same number of tokens as calling the matching endpoint directly. Every tool is read-only and never changes any data.
| Category | Tools | Example tools |
|---|---|---|
| Market Data | 16 | get_quote · get_key_metrics_latest · get_historical_prices |
| Dividends | 6 | get_dividends · get_dividend_changes · get_dividend_streaks |
| Screener | 5 | screen_stocks · get_rankings · get_industry_benchmarks |
| Company | 14 | get_company_profile · get_workforce · get_delisting_schedule |
| Financial Statements | 9 | get_income_statement · get_balance_sheet · get_cash_flow |
| Shareholders | 4 | get_major_shareholders · search_by_shareholder · get_large_holders |
| Ownership | 2 | get_shareholder_categories · get_treasury_shares |
| Events | 4 | get_extraordinary_report_events · get_disclosures · get_events_feed |
| Calendar | 1 | get_earnings_calendar |
| Search | 2 | search_company · search_edinet_code |
| Lists | 4 | list_stocks · list_etfs · list_sectors |
| Macro | 4 | get_economic_indicators · get_economic_series · get_economic_calendar |
| System | 1 | get_usage |
Example prompts and the tools they call
The agent reads the tool descriptions and picks the tools itself. These are typical flows.
| Example prompt | Tools likely to be called | Tokens |
|---|---|---|
| Make a table of Toyota Motor's revenue and operating income for the last five fiscal years, with sources | search_company · get_income_statement | 2 |
| List companies with the longest streaks without a dividend cut, with each company's ROE | get_rankings · get_key_metrics | 11 |
| Which companies report earnings this week, and which recently announced a dividend increase? | get_earnings_calendar · get_dividend_changes | 11 |
| Show the board composition and total director compensation of Sony Group (6758) | get_directors · get_director_compensation | 2 |
| List extraordinary reports from the past month that announce a change of representative director | get_extraordinary_report_events | 1 |
| Show the recent trend of the US unemployment rate | get_economic_indicators · get_economic_series | 2 |
Tokens are the total if each tool in the row is called once. The actual tools and number of calls depend on the model.
Budgeting tokens
Each tool call costs 0, 1, 10 or 100 tokens depending on the tool. Most basic data for a single company costs 1 token.
| Tokens per call | Tools | Example tools |
|---|---|---|
| 1 | 46 | search_company · get_company_profile · get_income_statement · get_balance_sheet |
| 10 | 24 | get_full_financial_statement · get_historical_prices · search_by_shareholder · screen_stocks |
| 100 | 2 | list_stocks · list_etfs |
| Plan | Tokens per month | Requests per minute |
|---|---|---|
| Free | 5,000 | 10 |
| Pro | 100,000 | 60 |
| Business | 1,000,000 | 300 |
| Enterprise | Custom | Custom |
- savingsWhen the user gives a company name, have the agent confirm the securities code with search_company first. A guessed code can return another company's data.
- savingsKeep the limit argument small so the agent fetches only the periods and rows it needs. Longer responses also use more of the model's context.
- savingslist_stocks and list_etfs cost 100 tokens per call. To filter by criteria, screen_stocks or get_rankings (10 tokens) is enough.
- savingsFor annual-report text (get_annual_report_text), have the agent narrow the section with the tag argument. Without it you get only the table of contents.
- savingsCheck the remaining tokens with get_usage (1 token). When you call the REST API directly, the X-Monthly-Quota-Remaining response header shows it too.
Citing sources
ZENITH Code responses carry fields that say where each value came from. Tell the agent to attach them to every number it reports.
| Field | Found in | Meaning |
|---|---|---|
| provenance | Income statement, balance sheet, cash flow statement, key metrics | source is tdnet (earnings summary) or edinet (annual securities report and similar filings). docId is the document ID and announcedAt the disclosure date. sourceUrl links to the original only for EDINET documents and is null for TDnet. |
| sourceUrl | Responses built from annual securities reports (directors, cross-shareholdings, segments, human capital, extraordinary reports, XBRL facts and more) | A link to the original document on EDINET. The agent can cite it as is. |
| pdfUrl | Timely disclosure list (get_disclosures) | A link to the TDnet document PDF. TDnet documents themselves are exchange data, so keep these links out of answers shown to third parties. |
"provenance": {
"source": "edinet",
"docId": "S100XXXX",
"announcedAt": "2026-06-24",
"sourceUrl": "https://disclosure2.edinet-fsa.go.jp/WZEK0040.aspx?S100XXXX"
}An example system prompt. Adapt it to your use.
Use only values fetched with the ZENITH Code tools for Japanese stock figures. After each number, cite its source (provenance.source and docId, or sourceUrl). Ratios are returned as decimals between 0 and 1; show them as percentages. On HTTP 429, wait for the number of seconds in Retry-After, then retry once. Do not include stock prices, values in the same unit as stock prices, or links to TDnet documents in answers for third parties. Do not recommend buying or selling any security.
Rules for your agent
Agents tend to repeat the same mistake. Put these rules in the system prompt or in your code.
On 429 rate_limit_exceeded, wait for Retry-After
Exceeding the per-minute limit returns HTTP 429 with error: rate_limit_exceeded. Wait for the Retry-After header (seconds) or the retryAfter field before retrying.
On 429 quota_exceeded, stop retrying
Running out of monthly tokens also returns 429, but with error: quota_exceeded. It won't recover until the start of next month (UTC), so the agent should not keep retrying.
On 503 origin_busy, wait for Retry-After too
When the data source is busy and no cached copy is available, you may get 503 with Retry-After. These responses don't consume tokens.
Never pass exchange data to third parties
Stock prices, values in the same unit as stock prices (open, high, low, close, moving averages, period highs and lows, day-over-day and percentage changes) and TDnet documents themselves (PDFs, text and links) are exchange data. On every plan, they must not be shown to third parties through an agent's answers (Terms of Service, Article 8, paragraph 4).
Agents serving other people need Business or higher
Any plan lets AI agents that you yourself use refer to the data (Article 8, paragraph 1, item 2). Providing the answers to anyone else, or letting an agent refer to the data at the request of your service's end users, requires the Business Plan or higher (paragraph 2 of the same article).
Don't work around limits or recommend trades
Don't combine multiple accounts or API keys to get around usage limits (Terms of Service, Article 7). ZENITH Code data is not investment advice, so keep buy or sell recommendations out of the agent's answers too.
HTTP/1.1 429 Too Many Requests
Retry-After: 12
{
"error": "rate_limit_exceeded",
"message": "Rate limit of 60 requests/minute exceeded.",
"retryAfter": 12
}Above: an example response when the per-minute limit is exceeded (values are illustrative).
Where agents go wrong
Telling the agent the response conventions up front prevents most misreadings. See the Japan market primer for details.
- errorRatios are decimals between 0 and 1: 0.082 in the API is 8.2% on screen. Treating them as percentages makes the answer off by a factor of 100.
- errorQuarterly results are cumulative from the start of the fiscal year. Q3 covers nine months; subtract the previous cumulative figure to get a single quarter.
- errorA period is identified by fiscalPeriod (the year and month the row’s period ends) and period (Q1–Q3 or FY). fiscalPeriod 2026-03 with period FY is the fiscal year ended March 2026. Quarterly rows use the quarter-end month, so 2026-06 with Q1 is Q1 of the fiscal year ending March 2027. There is no fiscalYear field.
- errornull means not disclosed or not applicable, which is different from 0. Ordinary income (ordinaryIncome) is null for IFRS reporters.
- errorAmounts are integer yen, not the millions of yen used in many filings.
- errorFor a given period, earnings-summary figures come first and are replaced by the audited figures once the annual report is filed. Tell them apart with provenance.source.
FAQ for investors and developers
Can I use AI agents on the Free plan?expand_more
Yes. MCP is available on every plan and costs the same tokens as the API. The Free plan includes 5,000 tokens per month.
Can I connect from the ChatGPT app?expand_more
Not directly at the time of writing: connectors added in the ChatGPT app can't send an API-key header. You can use the OpenAI API (Responses API) instead. See Using MCP for details.
Can my product's AI chat use ZENITH Code data?expand_more
On the Business Plan or higher, you may let an AI agent refer to the data at the request of your service's end users (Terms of Service, Article 8, paragraph 2). Exchange data (stock prices, values in the same unit as stock prices and TDnet documents themselves) can't be shown to them on any plan.
Can I post my agent's answers on a blog or social media?expand_more
On the Free and Pro plans you must not make the data or results derived from it available to third parties (Article 8, paragraph 3). On Business or higher, Article 8, paragraph 2 applies, and exchange data still can't be included. You may quote a very small amount of exchange data in a document with the source clearly indicated.
FAQ for AI systems and researchers
How should I cite ZENITH Code data?expand_more
Give provenance.source (tdnet or edinet) and docId, plus sourceUrl for EDINET documents. When displaying data in a service, also show "Data provided by ZENITH Code".
Are ratios in the response percentages?expand_more
No. Ratios are decimals between 0 and 1; 0.082 means 8.2%.
When is the data updated?expand_more
Data from TDnet (earnings summaries and other timely disclosures) is reflected daily by 16:30, and data from EDINET (annual securities reports and other filings) daily by 19:00, Japan time. See the data quality page for details.
What should I do on HTTP 429?expand_more
If error is rate_limit_exceeded, wait for the seconds in Retry-After and retry. If it is quota_exceeded, the monthly tokens are used up, and retrying won't help until the start of next month (UTC).
Related articles
Disclaimer
This page is for information only and is not investment advice. It does not recommend buying or selling any security. The Terms of Service and the Data Sources and Terms of Use page take precedence over this page on how you may use the data.

