<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: NEXUS tools</title>
    <description>The latest articles on DEV Community by NEXUS tools (@japanaitools).</description>
    <link>https://dev.to/japanaitools</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4222469%2Fe976ce96-c877-48dc-8ccd-f09f5f3cb168.png</url>
      <title>DEV Community: NEXUS tools</title>
      <link>https://dev.to/japanaitools</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/japanaitools"/>
    <language>en</language>
    <item>
      <title>grep can't check the numbers in a Japanese LLM summary. Here is why, and a small fix.</title>
      <dc:creator>NEXUS tools</dc:creator>
      <pubDate>Wed, 11 Nov 2026 06:23:32 +0000</pubDate>
      <link>https://dev.to/japanaitools/grep-cant-check-the-numbers-in-a-japanese-llm-summary-here-is-why-and-a-small-fix-12n2</link>
      <guid>https://dev.to/japanaitools/grep-cant-check-the-numbers-in-a-japanese-llm-summary-here-is-why-and-a-small-fix-12n2</guid>
      <description>&lt;p&gt;Say your agent summarizes Japanese meeting transcripts. You want one cheap guardrail: every number in the summary must also appear in the transcript. In English you could almost do that with a regex over the digits. In Japanese you can't, because the same value is written in many ways.&lt;/p&gt;

&lt;p&gt;The transcript says 三千五百万円. The model writes 3,500万円. Same amount (35 million yen), zero shared digits. A few more pairs that a digit search misses:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Transcript&lt;/th&gt;
&lt;th&gt;Summary&lt;/th&gt;
&lt;th&gt;Same value?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;三千五百万円&lt;/td&gt;
&lt;td&gt;3,500万円&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;令和7年4月1日 (Japanese era date)&lt;/td&gt;
&lt;td&gt;2025/4/1&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;午後2時 ("2 o'clock p.m.")&lt;/td&gt;
&lt;td&gt;14:00&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1割5分 (old-style rate)&lt;/td&gt;
&lt;td&gt;15%&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;問い合わせ30件 (30 inquiries)&lt;/td&gt;
&lt;td&gt;30人 (30 people)&lt;/td&gt;
&lt;td&gt;no, wrong counter&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The last row is the dangerous kind. The digits match, so a naive check passes, but the unit changed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Normalize first, then compare
&lt;/h2&gt;

&lt;p&gt;I wrote JP Number Grounding for this. It pulls every quantity, date and time out of both texts, converts them to one form (kanji numerals, 万/億, full-width digits, era years, 午前/午後, counters), and then checks the summary against the source.&lt;/p&gt;

&lt;p&gt;Here is a real run. The source:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;来期の予算は三千五百万円とし、令和7年4月1日から開始する。説明会は午後2時から。問い合わせは30件あった。次回は5月18日。
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A summary with two mistakes in it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;予算は3,500万円、2025/4/1開始。説明会は14:00。問い合わせ30人。期限は5月1日。
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;jpnumground&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;check&lt;/span&gt;
&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"ok"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;  &lt;span class="c1"&gt;# False&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Fact in summary&lt;/th&gt;
&lt;th&gt;Normalized&lt;/th&gt;
&lt;th&gt;Status&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;3,500万円&lt;/td&gt;
&lt;td&gt;35000000円&lt;/td&gt;
&lt;td&gt;supported&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2025/4/1&lt;/td&gt;
&lt;td&gt;2025-04-01&lt;/td&gt;
&lt;td&gt;supported&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;14:00&lt;/td&gt;
&lt;td&gt;14:00&lt;/td&gt;
&lt;td&gt;supported&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;30人&lt;/td&gt;
&lt;td&gt;30人&lt;/td&gt;
&lt;td&gt;unit_mismatch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5月1日&lt;/td&gt;
&lt;td&gt;????-05-01&lt;/td&gt;
&lt;td&gt;unsupported&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;It caught both: the counter swap and a deadline (May 1) that nobody said. The meeting said the next session is May 18.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it compares with a digit search
&lt;/h2&gt;

&lt;p&gt;The repo ships 30 test cases. On them the tool flags the right cases 30/30, and a plain "are these digits in the source?" check gets 14/30. I wrote the cases and the rules, so read that as a regression suite, not a benchmark.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using it from an agent
&lt;/h2&gt;

&lt;p&gt;It is an MCP server, a CLI and a Python library. Python standard library only, no network calls, MIT.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"jp-number-grounding"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"python"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"-m"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"jpnumground.server"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"cwd"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"/path/to/jp-number-grounding"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A rule that works well in a system prompt: after writing minutes or a summary from Japanese text, call &lt;code&gt;jp_number_grounding_check&lt;/code&gt; and fix or drop every &lt;code&gt;unsupported&lt;/code&gt; fact before sending.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does not do
&lt;/h2&gt;

&lt;p&gt;It checks that values are present, not that they are used correctly. A summary can copy 15% from the source and attach it to the wrong item, and this tool will pass it. It only handles Japanese text, and it reports unknown number forms instead of guessing.&lt;/p&gt;

&lt;p&gt;Code and the 30 cases: &lt;a href="https://github.com/japan-ai-tools/jp-number-grounding" rel="noopener noreferrer"&gt;https://github.com/japan-ai-tools/jp-number-grounding&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>ai</category>
      <category>llm</category>
      <category>mcp</category>
    </item>
    <item>
      <title>Your AI agent rounds Japanese consumption tax per line. Japan says round once per rate.</title>
      <dc:creator>NEXUS tools</dc:creator>
      <pubDate>Mon, 02 Nov 2026 14:23:29 +0000</pubDate>
      <link>https://dev.to/japanaitools/your-ai-agent-rounds-japanese-consumption-tax-per-line-japan-says-round-once-per-rate-f87</link>
      <guid>https://dev.to/japanaitools/your-ai-agent-rounds-japanese-consumption-tax-per-line-japan-says-round-once-per-rate-f87</guid>
      <description>&lt;p&gt;If you let an AI agent draft invoices for Japanese customers, check one thing: how it rounds consumption tax.&lt;/p&gt;

&lt;p&gt;Since October 2023, a "qualified invoice" in Japan must round the tax &lt;strong&gt;once per invoice for each tax rate&lt;/strong&gt;, not line by line (&lt;a href="https://www.nta.go.jp/publication/pamph/shohi/shohizei_11.pdf" rel="noopener noreferrer"&gt;National Tax Agency pamphlet, Japanese&lt;/a&gt;). Language models tend to compute the tax on every line and add it up. On a small invoice that is already off by two yen:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Item (10%, tax excluded)&lt;/th&gt;
&lt;th&gt;Amount&lt;/th&gt;
&lt;th&gt;Tax rounded per line&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Copy paper&lt;/td&gt;
&lt;td&gt;1,999&lt;/td&gt;
&lt;td&gt;199&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Toner&lt;/td&gt;
&lt;td&gt;2,999&lt;/td&gt;
&lt;td&gt;299&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pens&lt;/td&gt;
&lt;td&gt;999&lt;/td&gt;
&lt;td&gt;99&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total&lt;/td&gt;
&lt;td&gt;5,997&lt;/td&gt;
&lt;td&gt;597 (should be 599)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two yen sounds small. For the accounting team it means the invoice does not match their books, and someone has to find out why.&lt;/p&gt;

&lt;h2&gt;
  
  
  A checker that computes instead of guessing
&lt;/h2&gt;

&lt;p&gt;JP Invoice Check is a small MCP server, CLI and Agent Skill (Python standard library only, no network, MIT). It checks the six items a qualified invoice must carry, the 8% reduced-rate marks, the totals per rate, and the rounding rule. It names the per-line mistake (&lt;code&gt;E_TAX_LINE_ROUNDING&lt;/code&gt;) separately from other wrong numbers, and every message comes in English and Japanese.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep the checker out of the agent's reach
&lt;/h2&gt;

&lt;p&gt;A reader pointed out that a check is worth little if the agent being checked can rewrite it. Version 0.2.0 follows that advice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The company rule (rounding method, tax included or excluded) is loaded once, when a person starts the server. No tool call can change it.&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;rounding&lt;/code&gt; field inside the invoice is ignored while a rule is loaded.&lt;/li&gt;
&lt;li&gt;Every result carries a sha256 fingerprint of the checking code.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="s2"&gt;"git+https://github.com/ayatrader/jp-invoice-check"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"jp-invoice-check"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"jp-invoice-check"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"--policy"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/etc/company/invoice_policy.json"&lt;/span&gt;&lt;span class="p"&gt;]}}}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For an invoice a supplier sent you (&lt;code&gt;role: receive&lt;/code&gt;), a different rounding method is legal, so it is a warning that says which method they used and the difference in yen.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/ayatrader/jp-invoice-check" rel="noopener noreferrer"&gt;https://github.com/ayatrader/jp-invoice-check&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Limits: it does not check whether a registration number is currently registered (that needs the NTA site), and it does not cover simplified invoices. It is a checking tool, not tax advice.&lt;/p&gt;

</description>
      <category>python</category>
      <category>ai</category>
      <category>mcp</category>
      <category>japan</category>
    </item>
  </channel>
</rss>
