Skip to main content
Glama
SmartBear

SmartBear MCP server

Official
by SmartBear

QTM4J: Upload Automation Result

qtm4j_upload_automation_result

Import automation test results into QTM4J and map them to a new or existing test cycle. Handles JUnit, TestNG, Cucumber, QAF, HP UFT, and SpecFlow files.

Instructions

Upload an automation result file to QTM4J and map the results to a test cycle. Supports JUnit XML, TestNG XML, Cucumber JSON, QAF, HP UFT, and SpecFlow formats.

Toolset: Test Automation

Parameters:

  • filePath (string) required: Path to the automation result file on disk. Filesystem contents can change between turns — always resolve this from a fresh scan, never from a previously seen path. Supported extensions: .xml, .json, .zip

  • format (enum) required: Format of the result file. Supported values: cucumber, testng, junit, qaf, hpuft, specflow

  • testCycleToReuse (string): Work key of an existing test cycle to reuse (e.g. 'TR-PRJ-1'). If omitted, a new test cycle is created.

  • environment (string): Name of the environment on which the test cycle was executed (e.g. 'Chrome', 'Staging'). Defaults to 'No Environment'.

  • build (string): Build name or version for the test cycle execution (e.g. '1.0.0-beta'). Defaults to blank.

  • isZip (boolean): Set to true when uploading a ZIP archive containing result files. Required for QAF format. (default: false)

  • attachFile (boolean): Set to true to upload attachments referenced in execution results. (default: false)

  • matchTestSteps (boolean): true — match test cases by summary AND test steps. false — match by summary or key only. (default: true)

  • appendTestName (boolean): Applicable to JUnit/TestNG only. Appends suite/test name to method name in test case summary.

  • fields (object): Additional fields to set on the test cycle, test case, and/or test case execution created during import.

Output Description: trackingId to poll import status, a message from the API, the filePath uploaded, and the format used.

Use Cases: 1. Upload automation results to QTM4J 2. Import test results from a CI/CD pipeline run 3. Link test results to an existing test cycle 4. Create a new test cycle from automation results 5. Upload JUnit, TestNG, Cucumber, QAF, HP UFT, or SpecFlow result files

Examples:

  1. User says 'upload my test results to QTM4J' — scan workspace, find single result file, confirm and upload

{
  "filePath": "./target/surefire-reports/TEST-results.xml",
  "format": "junit"
}

Expected Output: trackingId returned; import processing started in QTM4J

  1. User wants results linked to an existing test cycle

{
  "filePath": "./reports/cucumber.json",
  "format": "cucumber",
  "testCycleToReuse": "TR-PRJ-5",
  "environment": "Chrome",
  "build": "2.1.0"
}

Expected Output: Results mapped to test cycle TR-PRJ-5

  1. Upload QAF ZIP and set test cycle metadata

{
  "filePath": "./results/qaf-results.zip",
  "format": "qaf",
  "isZip": true,
  "fields": {
    "testCycle": {
      "summary": "Regression Run 2024-Q1",
      "labels": [
        "regression"
      ],
      "priority": "High"
    }
  }
}

Expected Output: ZIP uploaded; test cycle created with summary, labels, and priority

  1. User provides an unrecognised priority value — do NOT silently map to a similar word; ask the user first

{
  "filePath": "./reports/cucumber.json",
  "format": "cucumber",
  "fields": {
    "testCycle": {
      "priority": "critical"
    }
  }
}

Expected Output: Tool is NOT called yet. Inform the user that 'critical' was not recognised as a valid priority and ask them to confirm the correct value (e.g. from the available options). Do not map 'critical' to 'Blocker' or any other value without explicit user confirmation.

Hints: 1. NO PROJECT CONTEXT REQUIRED: Do NOT call set_project_context and do NOT ask the user for a project key, project ID, or any other project details. This tool works independently — never prompt the user for project information. 2. FILE DISCOVERY: Always do a fresh scan — never reuse a path from a previous turn. If no path is provided, search in order: target/surefire-reports, target/failsafe-reports, build/reports/tests, build/test-results, test-results, reports, cucumber-reports. If exactly one file is found, show the path and inferred format to the user and confirm before uploading. If multiple files are found, list them all and wait for the user to pick one. If nothing is found, ask for the path. Never pick or upload silently. 3. FORMAT INFERENCE: .json → cucumber (unambiguous). For .xml, infer from the file name — 'junit'/'surefire' → junit, 'testng' → testng, 'specflow' → specflow, 'hpuft'/'uft' → hpuft. For .zip, ALWAYS set isZip: true, but do NOT assume qaf — the zip could contain junit, testng, or cucumber results; if the format cannot be determined from the file name, ask the user. If the file name gives no clear signal for .xml either, ask the user to confirm the format. 4. TEST CYCLE: Only ask for testCycleToReuse if the user explicitly wants to link to an existing cycle. If not mentioned, omit it — QTM4J creates a new test cycle automatically. 5. DATE FORMAT: plannedStartDate and plannedEndDate in fields.testCycle MUST be formatted as 'dd/MMM/yyyy HH:mm' (e.g. '14/May/2026 10:30'). Convert any user-provided date (ISO, natural language, relative) to this exact format before sending. 6. FOLDER ID: folderId is a numeric ID. Apply it ONLY to the level the user specifies; if unspecified, default to fields.testCycle only — never copy it to both levels. Get the ID from the user directly (right-click folder in QTM4J → 'Copy Folder Id'). 7. ASSIGNEE / REPORTER: assignee and reporter in fields.testCycle and fields.testCase require a Jira Account ID (not a display name or email). Ask the user to provide their Account ID directly. 8. FIELD MAPPING CONFIRMATION: Apply formatting transformations (case correction, date/time conversion) automatically. Only ask for user confirmation when you cannot find a recognised match and need to substitute an unrecognised value with a guessed alternative — never silently substitute in that case. 9. TRACKING: Import processing is asynchronous. To check status, call get_automation_history and find the record whose trackingId matches the one returned from this tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
buildNoBuild name or version for the test cycle execution (e.g. '1.0.0-beta'). Defaults to blank.
isZipNoSet to true when uploading a ZIP archive containing result files. Required for QAF format.
fieldsNoAdditional fields to set on the test cycle, test case, and/or test case execution created during import.
formatYesFormat of the result file. Supported values: cucumber, testng, junit, qaf, hpuft, specflow
filePathYesPath to the automation result file on disk. Filesystem contents can change between turns — always resolve this from a fresh scan, never from a previously seen path. Supported extensions: .xml, .json, .zip
attachFileNoSet to true to upload attachments referenced in execution results.
environmentNoName of the environment on which the test cycle was executed (e.g. 'Chrome', 'Staging'). Defaults to 'No Environment'.
appendTestNameNoApplicable to JUnit/TestNG only. Appends suite/test name to method name in test case summary.
matchTestStepsNotrue — match test cases by summary AND test steps. false — match by summary or key only.
testCycleToReuseNoWork key of an existing test cycle to reuse (e.g. 'TR-PRJ-1'). If omitted, a new test cycle is created.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatYes
messageYes
filePathYes
trackingIdYes
Install Server

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description goes well beyond the annotations by disclosing that import processing is asynchronous and should be tracked via get_automation_history, that a new test cycle is created when testCycleToReuse is omitted, that QAF ZIP uploads require isZip=true, and that unrecognized priority values must not be silently substituted (Example 4). It also documents side-effect-relevant details like date formatting, folderId scoping, and Jira Account ID requirements for assignee/reporter.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a front-loaded summary, bold section headers, clear examples, and numbered hints, making it easy to scan. However, the 'Parameters' section largely duplicates the schema descriptions, and the 'Use Cases' list adds limited information beyond the opening paragraph, making the description longer than strictly necessary.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex tool with 10 parameters and nested fields, the description covers virtually everything an agent needs: file discovery order, format inference rules, confirmation requirements, test cycle reuse behavior, field conversion rules, and async tracking via get_automation_history. The worked examples illustrate realistic call patterns and even include a case where the tool should not be called, leaving no major operational gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although schema coverage is 100%, the description adds substantial meaning beyond the schema: filePath must be resolved from a fresh scan, testCycleToReuse expects a work key like 'TR-PRJ-1', isZip is required for QAF, matchTestSteps defines matching behavior, and appendTestName only applies to JUnit/TestNG. Hints 5-8 add critical subfield semantics for fields, such as date format, folderId scope, and Account ID requirements, which the schema alone does not fully convey.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence states a specific action ('Upload an automation result file'), the target system (QTM4J), and the outcome (map results to a test cycle), then lists the supported formats. This makes the tool's role immediately distinguishable from siblings like qtm4j_get_automation_history or qtm4j_create_test_cycle. The name itself is also descriptive, and the description reinforces it without repeating it tautologically.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The Hints section provides clear context for when the tool should or should not be called: fresh file scan required, confirm before uploading, ask when multiple/no files found, and explicitly 'Do NOT call set_project_context'. It does not, however, compare this tool against similar-looking siblings such as qmetry_import_automation_test_results, so the alternative-selection guidance is not fully explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SmartBear/smartbear-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server