Skip to content

Add tool to get launch by ID directly #76

@janmekota

Description

@janmekota

Add tool to get launch by ID directly

Problem

Currently, it's difficult to efficiently retrieve information about a specific launch when you have both the projectName and launchId.

The available tools (get_launches or get_last_launch_by_name) are inefficient for this use case, especially in projects with large datasets. For example, in a project with:

  • 10,584 total launches (starting from ID 81125)
  • 162 unique launch names

Using these tools requires pagination through potentially hundreds of launches to find a specific ID.

Real-World Examples

Example 1: Basic pagination search for launch 119000

Agent had to make 3 API calls with pagination:

User request: "Get details about ReportPortal launch with ID 119000 in project my_project"

1. get_launches (page 1, page-size 100)
   → Result: Shows launches starting from ID 120280
   → Agent reasoning: "Launch 119000 would be earlier. Let me fetch more pages."

2. get_launches (page 4, page-size 100)
   → Result: Shows launches starting from ID 118996
   → Agent reasoning: "Launch ID 119000 should be close by."

3. get_launches (page 3, page-size 100)
   → Result: Finally found launch 119000!

Total API calls: 3

Example 2: Extended pagination search

Agent had to make 5 API calls trying different pages:

User request: "Get details about ReportPortal launch with ID 119000 in project my_project"

1. get_launches (page 1, page-size 100)
   → Result: Launches down to 119903
   → Agent reasoning: "Launch 119000 would be on an earlier page."

2. get_launches (page 2, page-size 100)
   → Result: Launches down to 119326
   → Agent reasoning: "Need to continue looking."

3. get_launches (page 5, page-size 100)
   → Result: Launches down to 118080
   → Agent reasoning: "Launch 119000 should be around page 3-4."

4. get_launches (page 4, page-size 100)
   → Result: Launches down to 118557
   → Agent reasoning: "Launch ID 119000 should be between page 3 and 4."

5. get_launches (page 3, page-size 100)
   → Result: Found launch 119000!

Total API calls: 5

Example 3: Trial and error with different filters

Agent tried multiple approaches before finding the launch:

User request: "Get details about ReportPortal launch with ID 119000 in project my_project"

1. get_last_launch_by_name (launch="119000")
   → Result: Failed - 119000 is not a launch name
   → Agent reasoning: "Let me try get_launches with filters."

2. get_launches (filter-gte-number=119000, page 1, page-size 50)
   → Result: No exact match
   → Agent reasoning: "The launch might have been deleted. Let me get recent launches."

3. get_launches (page 1, page-size 10)
   → Result: Most recent launches have IDs in 120000+ range
   → Agent reasoning: "Launch 119000 might be from earlier date."

4. get_launches (filter-btw-startTime-from="2025-12-01", filter-btw-startTime-to="2026-01-10", 
                 page 1, page-size 100, page-sort="number,DESC")
   → Result: Lowest ID shown is 118583
   → Agent reasoning: "Launch 119000 would be somewhere in between."

5. get_launches (filter-gte-number=8600, page 1, page-size 100, page-sort="id,ASC")
   → Result: Results start from launch ID 117553
   → Agent reasoning: "Launch 119000 should be in a higher range."

6. get_launches (page 1, page-size 50, page-sort="id,DESC")
   → Result: Still searching...
   → Agent conclusion: "Launch 119000 either doesn't exist, has been deleted, 
                        or project name might be incorrect."

Total API calls: 6 (and still didn't find the launch reliably)

Impact

All three scenarios demonstrate the same issue: when the launch ID is already known, direct retrieval should be possible without pagination or trial-and-error filtering.

This inefficiency:

  • Wastes multiple API calls (3-6+ calls instead of 1)
  • Increases latency for the user
  • Confuses LLM agents with unnecessary complexity
  • Makes the MCP server less useful for direct launch queries

Proposed Solution

Add a new tool get_launch_by_id that directly retrieves a launch by its ID, leveraging the existing ReportPortal API endpoint:

GET /v1/{projectName}/launch/{launchId}

Tool signature example:

{
  "name": "get_launch_by_id",
  "description": "Get a specific launch by its ID directly",
  "parameters": {
    "project": {
      "type": "string",
      "description": "Project name",
      "required": true
    },
    "launchId": {
      "type": "number",
      "description": "Launch ID",
      "required": true
    }
  }
}

Usage example:

{
  "project": "my_project",
  "launchId": 119000
}

This would allow direct and efficient access to launch details with a single request.

Use Case

When an LLM agent (e.g., GitHub Copilot with Claude Sonnet 4.5 in IntelliJ IDEA) knows both the project name and launch ID, it should be able to retrieve the launch information immediately without:

  • Multiple pagination attempts
  • Searching through hundreds of results
  • Trying different filtering strategies
  • Wasting API calls and user time

Environment

  • MacBook Pro: Apple M1 Pro, macOS Tahoe 26.2
  • MCP Server: reportportal/mcp-server:1.1.1 (Docker)
  • Client: IntelliJ IDEA 2025.3.1 with GitHub Copilot plugin 1.5.62-243
  • LLM: Claude Sonnet 4.5
  • Project stats: 10,584 launches with 162 unique launch names

Expected Behavior After Fix

User: "Get details about ReportPortal launch with ID 119000 in project my_project"

Agent: get_launch_by_id(project="my_project", launchId=119000)
→ Single API call
→ Instant result

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions