Skip to content
This repository was archived by the owner on Feb 26, 2026. It is now read-only.

fix: ensure all tool responses are JSON-serializable#24

Open
oheckmann74 wants to merge 1 commit into
JoshuaRileyDev:mainfrom
oheckmann74:fix/list-group-testers-serialization
Open

fix: ensure all tool responses are JSON-serializable#24
oheckmann74 wants to merge 1 commit into
JoshuaRileyDev:mainfrom
oheckmann74:fix/list-group-testers-serialization

Conversation

@oheckmann74

Copy link
Copy Markdown

Summary

Several MCP tool handlers return { toolResult: ... } which doesn't properly serialize the response. This causes tools like list_group_testers to return [object Object] instead of actual tester data.

Problem

When calling list_group_testers, the MCP client receives:

[object Object]

Instead of the actual tester data array.

Root Cause

The list_apps and get_app_info handlers use formatResponse():

case "list_apps":
  const appsData = await this.appHandlers.listApps(args as any);
  return formatResponse(appsData);  // ✓ Works correctly

But most other handlers return raw objects:

case "list_group_testers":
  return { toolResult: await this.betaHandlers.listGroupTesters(args as any) };  // ✗ Broken

Solution

Changed all affected handlers to use formatResponse() which wraps responses in the proper MCP content format with JSON.stringify().

Affected Tools

  • list_beta_groups
  • list_group_testers
  • add_tester_to_group
  • remove_tester_from_group
  • create_app_store_version
  • list_app_store_versions
  • list_app_store_version_localizations
  • get_app_store_version_localization
  • update_app_store_version_localization
  • create_bundle_id
  • list_bundle_ids
  • get_bundle_id_info
  • enable_bundle_capability
  • disable_bundle_capability
  • list_devices
  • list_users
  • create_analytics_report_request
  • list_analytics_reports
  • list_analytics_report_segments
  • download_analytics_report_segment
  • download_sales_report
  • download_finance_report
  • list_schemes

Test Plan

  • Build succeeds (npm run build)
  • Call list_group_testers with a valid group ID
  • Verify response contains actual tester data (names, emails, IDs)
  • Verify other affected tools also return properly formatted JSON

Many tool handlers were returning `{ toolResult: ... }` which doesn't
properly serialize the response for MCP clients. This causes tools like
`list_group_testers` to return `[object Object]` instead of actual data.

Changed all affected handlers to use the existing `formatResponse()`
helper which wraps responses in the proper MCP content format with
`JSON.stringify()`.

Affected tools:
- list_beta_groups
- list_group_testers
- add_tester_to_group
- remove_tester_from_group
- create_app_store_version
- list_app_store_versions
- list_app_store_version_localizations
- get_app_store_version_localization
- update_app_store_version_localization
- create_bundle_id
- list_bundle_ids
- get_bundle_id_info
- enable_bundle_capability
- disable_bundle_capability
- list_devices
- list_users
- create_analytics_report_request
- list_analytics_reports
- list_analytics_report_segments
- download_analytics_report_segment
- download_sales_report
- download_finance_report
- list_schemes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant