Add rich menu insight summary and daily tools - #515
Open
4geru wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, andto(yyyyMMdd) as inputs and are marked withreadOnlyHint. 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
src/tools/getRichMenuInsightSummary.tsandsrc/tools/getRichMenuInsightDaily.ts, registered insrc/index.tstest/helpers/mock-line-clients.ts@line/bot-sdkto^11.1.0, which addsgetRichMenuInsightSummary/getRichMenuInsightDailytoLineBotClientNote
@line/bot-sdk11.1.0 was published on 2026-07-01, so withmin-release-age=7in.npmrc,npm installin CI may not resolve it until around 2026-07-08.Testing
npm run build(includes prettier check and typecheck) passesnpm testpasses (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
richMenuIdis returned.get_rich_menu_insight_summary
get_rich_menu_insight_daily