Skip to content

fix(pricing): report unknown prices and limit regional requests - #72

Merged
TMHSDigital merged 1 commit into
TMHSDigital:mainfrom
ect2000:fix/pricing-availability
Oct 25, 2026
Merged

TMHSDigital merged 1 commit into
TMHSDigital:mainfrom
ect2000:fix/pricing-availability

Conversation

@ect2000

@ect2000 ect2000 commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

The price tools infer free: true whenever Steam omits price_overview. That price-only response is also used for coming-soon, delisted and unavailable listings, so it cannot establish that an app is free.

Closes #33.

Changes:

  • Missing listed prices return { price_overview: null, reason: "no_price_listed" } in both tools. Successful paid-price payloads and region-lock errors keep their existing behavior.
  • Replace the default pseudo-country EU with DE, including the tool's input description.
  • Preserve each failed region's error message and error class while letting other regions complete.
  • Limit a regional invocation to four in-flight fetches, including its maximum twenty-country input. This is a per-invocation limit, not a global rate limiter.

The price-only endpoint also omits authoritative free-app metadata, so genuinely free apps get the same honest unknown-price result. The batch remains one request; this fix does not add up to fifty separate metadata lookups or claim a free status without evidence.

Verification on Node 24.13.1, after merging current main and reinstalling its SDK/Zod dependencies:

  • All five new regressions fail against the original pricing logic.
  • npm test: 140 passed, including free/coming-soon price-only fixtures, unavailable regions, paid prices, the default eurozone country, typed partial failures and a deterministic twenty-country concurrency test (peak four).
  • npm run build and git diff --check pass.
  • Two read-only live Store API requests returned HTTP 200: app 440 had successful array data with no listed price, while app 400 had object data with a listed price. No API key or Steam mutation was involved.

Signed-off-by: Emilio Castejón <107069576+ect2000@users.noreply.github.com>
@TMHSDigital

Copy link
Copy Markdown
Owner

Thanks, the fix itself looks right: the logic, the tests, and the eurozone default.

While this was open, main moved every tool from the deprecated server.tool() to server.registerTool(). That makes the fake server in pricing.test.ts find no handler, and all five tests fail with server.registerTool is not a function. That's the CI failure here. It's on our side, not a problem with your change.

The fix is one line, line 18 of pricing.test.ts:

-  register({ tool(...args: unknown[]) { handler = args[args.length - 1] as Handler; } } as unknown as McpServer);
+  register({ registerTool(...args: unknown[]) { handler = args[args.length - 1] as Handler; } } as unknown as McpServer);

Your commit, merged with current main and with that change plus a CHANGELOG entry crediting you, passes every CI job in #73 (Node 22 and 24, coverage, Docker, secrets scan). Could you apply the line above, or pull b055056 from the review/pr-72-pricing branch? Otherwise a maintainer can push it to your branch. #73 is only for CI and will be closed.

🤖 Generated with Claude Code

@TMHSDigital
TMHSDigital merged commit 63dd2d7 into TMHSDigital:main Oct 25, 2026
2 of 5 checks passed
@TMHSDigital

Copy link
Copy Markdown
Owner

Merged, thanks! Your commit 66a9aac landed on main unchanged and under your authorship. It went in together with the one-line registerTool test fix described above and a CHANGELOG entry crediting you. CI on main is green.

🤖 Generated with Claude Code

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.

Price tools report free: true for unreleased, delisted, or not-for-sale apps

2 participants