Skip to main content
Glama
SmartBear

SmartBear MCP server

Official
by SmartBear

QTM4J: Upload Automation Result

qtm4j_upload_automation_result

Uploads automation result files (JUnit, TestNG, Cucumber, QAF, HP UFT, SpecFlow) to QTM4J and maps them to test cycles, creating new cycles or reusing existing ones.

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
Behavior5/5

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

Annotations indicate read/write and non-destructive behavior. The description adds that import is asynchronous, requires tracking via get_automation_history, and creates new cycles unless reusing. No contradictions with annotations.

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 clear sections (parameters, output, use cases, examples, hints) but is verbose. Given the complexity of 10 parameters and nested objects, the length is justified, though slight tightening could improve conciseness.

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?

Covers all crucial aspects: inputs, async behavior, side effects, user interaction guidelines, date format requirements, and links to follow-up tools. Extremely complete for a complex mutation tool with nested parameters.

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?

All 10 parameters have schema descriptions (100% coverage). The description enriches these with context: filePath must be from a fresh scan, date format requirements (dd/MMM/yyyy HH:mm), assignee/reporter require Jira Account ID, and folderId usage details.

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 description clearly states the tool's purpose: uploading automation result files to QTM4J and mapping results to test cycles. It lists supported formats, parameters, use cases, and distinguishes itself from siblings by explicitly stating no project context is required and referencing related tools like get_automation_history.

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

Usage Guidelines5/5

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

Extensive guidelines are provided, including when to use (e.g., upload results from CI/CD), when not to use (avoid set_project_context), file discovery strategies, format inference rules, and user confirmation procedures for unrecognized values. Examples illustrate proper invocation.

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

Install Server

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