Skip to content

feat(test-management): add listTestPlans and getTestPlan tools#283

Merged
gaurav-singh-9227 merged 1 commit intobrowserstack:mainfrom
manoj-k04:feat/tm-test-plan-tools
Apr 27, 2026
Merged

feat(test-management): add listTestPlans and getTestPlan tools#283
gaurav-singh-9227 merged 1 commit intobrowserstack:mainfrom
manoj-k04:feat/tm-test-plan-tools

Conversation

@manoj-k04
Copy link
Copy Markdown
Collaborator

@manoj-k04 manoj-k04 commented Apr 27, 2026

Summary

  • Adds listTestPlans and getTestPlan MCP tools, exposing BrowserStack Test Plans as first-class objects (previously agents fell back to test runs when given a TP-* identifier).
  • getTestPlan chains GET /test-plans/{id} + GET /test-plans/{id}/test-runs and returns a unified payload: metadata, linked runs, total test-case count across runs, and a derived run-state summary — suitable for auto-generating test documentation / QA status reports.
  • listTestPlans covers discovery when the TP-* identifier is not known, mirroring the existing listTestRuns pattern.

Customer context

This is driven by a customer use case (Danske / Himanshu's Slack thread): they want to auto-generate Confluence test documentation from a Test Plan ID via MCP. Current behavior either returns test runs or nothing. This PR covers 4 of the 5 fields they asked for:

Customer ask Covered
Metadata (id, name, status, description) getTestPlan
Linked Epics / Requirements ❌ Not in the public Test Plans API — tracked as a follow-up
Linked Test Runs getTestPlan
Scope (# of test cases) getTestPlantotal_test_cases derived from linked runs
Status summary getTestPlanstatus_summary + test_runs_count

Test plan

  • npm test — 127 passing (4 new tests: success + error for each tool)
  • npx tsc --noEmit — clean
  • npm run lint — clean
  • npm run build — produces dist/tools/testmanagement-utils/{list-testplans,get-testplan}.js
  • Stdio smoke test: tools/list via dist/index.js advertises both listTestPlans and getTestPlan
  • Live smoke test against a real BrowserStack TM project with a real TP-* (pending reviewer)

🤖 Generated with Claude Code

Expose Test Plans as first-class objects in the MCP so agents can retrieve
a plan by TP-* identifier instead of falling back to test runs.

getTestPlan chains the plan-details and linked-runs endpoints into a unified
response with metadata, linked test runs, total test-case count across runs,
and a derived run-state summary — suitable for generating test documentation
and QA status reports. listTestPlans covers discovery when the identifier is
not known.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gaurav-singh-9227 gaurav-singh-9227 merged commit 19b3676 into browserstack:main Apr 27, 2026
1 check passed
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.

3 participants