Skip to content

Add rich menu insight summary and daily tools - #515

Open
4geru wants to merge 1 commit into
line:mainfrom
4geru:4geru/add-rich-menu-insight-tools
Open

Add rich menu insight summary and daily tools#515
4geru wants to merge 1 commit into
line:mainfrom
4geru:4geru/add-rich-menu-insight-tools

Conversation

@4geru

@4geru 4geru commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds two new tools for the rich menu Insight API endpoints introduced in line/line-openapi#128:

  • get_rich_menu_insight_summary — Gets a summary of rich menu statistics for the specified period, aggregated over the entire period as a single result (GET /v2/bot/insight/richmenu/{richMenuId}/summary).
  • get_rich_menu_insight_daily — Gets rich menu statistics broken down by day for the specified period (GET /v2/bot/insight/richmenu/{richMenuId}/daily).

Both tools take richMenuId, from, and to (yyyyMMdd) as inputs and are marked with readOnlyHint. The date period constraints differ per the API spec (up to 396 days for summary, up to 99 days for daily), so they are documented in each tool's input descriptions.

News: https://developers.line.biz/en/news/2026/07/01/rich-menu-insight/

Changes

  • Add src/tools/getRichMenuInsightSummary.ts and src/tools/getRichMenuInsightDaily.ts, registered in src/index.ts
  • Add tool tests (success / API error / invalid date format) and mock methods in test/helpers/mock-line-clients.ts
  • Update the tool lists in README.md and README.ja.md
  • Bump @line/bot-sdk to ^11.1.0, which adds getRichMenuInsightSummary / getRichMenuInsightDaily to LineBotClient

Note

@line/bot-sdk 11.1.0 was published on 2026-07-01, so with min-release-age=7 in .npmrc, npm install in CI may not resolve it until around 2026-07-08.

Testing

  • npm run build (includes prettier check and typecheck) passes
  • npm test passes (48/48, including 6 new test cases)

Screenshots

End-to-end demo in Claude Code against a real LINE Official Account.
The responses show the privacy-threshold case where only richMenuId is returned.

get_rich_menu_insight_summary

01-summary-tool-call 02-summary-result

get_rich_menu_insight_daily

03-daily-tool-call 04-daily-result

Add get_rich_menu_insight_summary and get_rich_menu_insight_daily tools
based on the Insight API added in line/line-openapi#128.
Requires @line/bot-sdk 11.1.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants