Bug: Usage stats display broken β [object Object] and undefined for PAID tier accounts
Description
All tools that display API usage stats (check_usage, search_icons, etc.) show malformed output when using a PAID tier account:
π API Usage: [object Object]/undefined (monthly)
And in check_usage:
Monthly Limit: undefined requests
Used: [object Object] requests
Remaining: NaN requests
Usage Rate: NaN%
Root Cause
The code assumes monthly.usage is a number and monthly.limit is a defined number, but the actual Noun Project API v2 /client/usage response returns monthly.usage as an object and monthly.limit as undefined β likely because PAID accounts have no hard limit.
Affected lines:
dist/tools/search.js:92 β `${usage_limits.monthly.usage}/${usage_limits.monthly.limit}`
dist/tools/usage.js:61β62 β const usage = monthly.usage; const limit = monthly.limit;
Environment
NOUN_API_TIER=PAID
- Package:
@alisaitteke/noun-mcp (latest via npx -y)
- All core functionality (search, get icon, download) works correctly β only the usage display is broken
Expected Behavior
Either display the raw usage object properly, or gracefully handle undefined limits (e.g. show "Unlimited" for PAID tier).
Suggested Fix
Log the raw API response from GET /v2/client/usage and update the destructuring in formatUsageInfo and formatSearchResults to match the actual response shape. For PAID tier, treat null/undefined limit as unlimited.
Debugged with assistance from Claude Code (claude-sonnet-4-6)
Bug: Usage stats display broken β
[object Object]andundefinedfor PAID tier accountsDescription
All tools that display API usage stats (
check_usage,search_icons, etc.) show malformed output when using a PAID tier account:π API Usage: [object Object]/undefined (monthly)
And in
check_usage:Monthly Limit: undefined requests
Used: [object Object] requests
Remaining: NaN requests
Usage Rate: NaN%
Root Cause
The code assumes
monthly.usageis a number andmonthly.limitis a defined number, but the actual Noun Project API v2/client/usageresponse returnsmonthly.usageas an object andmonthly.limitasundefinedβ likely because PAID accounts have no hard limit.Affected lines:
dist/tools/search.js:92β`${usage_limits.monthly.usage}/${usage_limits.monthly.limit}`dist/tools/usage.js:61β62βconst usage = monthly.usage; const limit = monthly.limit;Environment
NOUN_API_TIER=PAID@alisaitteke/noun-mcp(latest vianpx -y)Expected Behavior
Either display the raw usage object properly, or gracefully handle
undefinedlimits (e.g. show "Unlimited" for PAID tier).Suggested Fix
Log the raw API response from
GET /v2/client/usageand update the destructuring informatUsageInfoandformatSearchResultsto match the actual response shape. For PAID tier, treatnull/undefinedlimit as unlimited.Debugged with assistance from Claude Code (claude-sonnet-4-6)