Prompts library
The API Agent prompts library provides a comprehensive guide on using prompts to complete various tasks.
Guidelines for using prompts
To achieve accurate and efficient results, use the following guidelines when you enter the prompt:
- Avoid the words or tone that convey sarcasm or humor, as they can be misinterpreted.
- Use active voice, correct grammar, spelling, and keep your request clear and specific.
- Provide clear context and relevant keywords, and avoid vague or domain-specific terms. For
example,
generate testorbuild API. - If the system is unable to understand your request, it offers suggestions for the requests.
Prerequisites
The API Agent plug-in can be used to complete tasks that are related to API Connect.
- Ensure that you are logged in to API Agent. For login and operation instructions, see Getting started.
- You must have valid permissions to use the API Agent. For more information, see API Agent user roles.
- Ensure that you have the same permissions through the API Connect’s API Manager interface. Even if you have permission to use the API Agent plug-in, actions fail if you do not have the necessary permissions to complete the same tasks through the API Manager UI.
Usage of prompts for different cases
The following table explains the prompts and its usage for different actions.
| Action | Prompt | Description |
|---|---|---|
| Generating test cases |
Generate test cases for the API
|
|
| Running test cases |
Run test cases for the API
Note: The
<published api name> must contain the name of the API. Do not combine
the version information. For example, petstore. |
|
| Deleting test cases |
|
|
| Listing test suites |
|
You can use to list test suits. Also, you can delete a test suite by entering a prompt with the suite name. |
| Deleting test suite |
|
|
| Listing test cases |
|
|
| Creating an OpenAPI |
|
The following are the examples of prompts that you can use to create an Open API |
| Generating code |
|
|
| [Technology preview] MCP server |
|
Use the following prompts to do the following actions with the MCP server:
|
Sequential prompts
You can use API Agent to chain multiple tools together in a single prompt and then run one after another. The following
are examples of sequential prompts:
- To create and run test cases
create test cases for the petstore api and run the test cases
- To list draft or published APIs or products
list draft apis, draft products, published apis and published productsOrlist published apis
- To create a draft API and generate FastAPI server code
create draft api from file @openapi.yaml and generate fastapi server code from the same api fileOrcreate draft api using @file_name - To review security of an API
review security of api API_NAME:VERSION - To review security and validate an API
review security of api API_NAME:VERSIONOrvalidate api API_NAME:VERSION