Best practices for MCP prompting

With the qTest MCP, you can integrate your LLM with tools that let you review and manage your testing process with natural language. For example, you can tell the AI to figure out what defects you should create from a failed test run, and it will do the legwork for you.

Effective prompting is key to getting the most out of your qTest MCP integration. This topic provides proven patterns, examples, and best practices for natural language interactions with your performance testing platform, along with any required information you may need to include in your prompts.

Prompt information

As you work with the MCP, you should organize your prompts like a funnel. Start with the broadest information first, so the AI can reference it throughout your session. However, to avoid expensive, resource-consuming queries, you should also know exactly where you want to start.

For example, when you start a session, first you need to access the project you want to work in. Just tell the AI, "Give me the details about project [ID number]." Then, the AI continues to reference this project in further interactions.

This can extend to requirements and test cases. If you ask the AI, "Give me all the test cases in project [ID number]," the AI will spend time and resources gathering all test cases. However, if you know what requirement you want to work with, you can ask the AI to "Give me all test cases attached to requirement [ID number]".

Locate ID numbers

Currently, you must reference project and object ID numbers to pull up specific objects with MCP tools. To find these, open up the object you want to work with in qTest, and take a look at the URL.

Your project ID is the first number in the URL, located after /p/, which specifies the project you're working with in your qTest instance. Your object ID is the second number, located after id=. This specifies the object you currently have open, whether its a requirement, module, test case, or something else.

For example, let's take a look at the following project URL: https://[sample].qtestnet.com/p/115973/portal/project#id=27374334.

In this case, the project ID is 115973, and the object ID is 27374334. This example is a requirement ID, but the object ID will remain in the same location across objects of all types.

Available MCP actions

Once connected, you have access to these actions that you can use to interact with qTest.

If you are directly referencing a new project, or you want to pull up a specific object, you need to give the MCP the project or object ID number. If you've already referenced the project or object during your session, you don't need to include the ID number again.

Keep in mind that these prompts are an example. You can adjust and build on them to better meet your needs.

Action

Example prompt

Required input

Retrieve a list of projects Can you show me all projects attached to this qTest instance?  

Retrieve a project

Can you show me details for project 115973?

Project ID

Retrieve a list of requirements from a project

What requirements are in project 115973?

What requirements are in this project?

Project ID, Object ID

Get details for a requirement Can you show me the details for requirement 27374334? Object ID

Retrieve a list of test cases from a project

Show me test cases from project 115973.

Show me a list of open test cases in this project.

Project ID

Retrieve detailed information for a specific test case

Can you show me details for test case 27374326?

Object ID

Create a new test case

Create a list of test cases that covers this requirement.

Create a test case that covers the login requirements we just talked about.

 

Update a test case

Can you create more detailed test steps for test case 27374326?

Can you update the description for this test case to better match the requirement?

Object ID

Create a new test case in a module hierarchy

Create a test case that addresses this requirement and add it to a new module named Homepage.

 

Create a new module

Create a new module named Homepage for project 115973.

Create a new module named Homepage.

Project ID

Search for modules or submodules in a qTest project, including by case-sensitive name

Can you list the modules in project 115973?

Can you list the modules in this project?

Can you show me the Homepage module?

Project ID

Link test cases to a requirement

Link these test cases to requirement 27374334.

Link test case 27374326 to requirement 27374334.

Link this test case to the requirement we just looked at.

Object ID

Provide summaries of test cases linked to a specific requirement

What test cases are linked to requirement 27374334?

What test cases are linked to this requirement?

Object ID

List test runs for a test case

Can you show me the test runs associated with test case 27374326?

Can you show me the test runs attached to this test case?

Object ID

Retrieve test logs for a specific test run with detailed analysis, such as pass or fail

Show me all test logs for test run 27374375.

Show me all test logs for this test run.

Object ID

Create a defect and link it to a test log

Review test run 27374375 and create a list of defects that cover the failures in the test logs.

OK, now create a list of defects that cover the failures in the test logs.

Object ID

Core principles

Follow these fundamental principles to create effective MCP prompts and avoid common pitfalls:

Language guidelines

Follow these language guidelines for effective communication:

Project operations

Use these prompt patterns to navigate and learn more about your project:

Common workflow patterns

Use these workflow patterns for typical test case and defect creation scenarios:

Effective prompt patterns

Use these proven patterns to structure your prompts for better results:

Advanced techniques

Use these advanced techniques for more sophisticated interactions:

What's next?

Now that you understand MCP prompting best practices, you can connect qTest to the MCP.