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, follow these guidelines when entering prompts:
- Avoid 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 test or build API.
- If the system cannot understand your request, it offers suggestions for alternative requests.
Prerequisites
Ensure the following before using API Agent prompts:
- Log in to API Agent. For login and operation instructions, see Getting started.
- You must have valid permissions to use API Agent. For more information, see API Agent user roles.
- Ensure you have the same permissions through the API Connect's API Manager interface. Actions fail if permissions do not match.
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
APINote: The
<published
api name> must contain the name of the API. Do not combine the version information. For
example, petstore. |
|
| Deleting test cases |
|
Click the hyperlink to view the results of the individual test cases in the API Manager console. |
| 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 |
|
Generates FastAPI server code based on OpenAPI specification. |
| MCP server actions |
|
Use the following prompts to do the following actions with the MCP server:
|
Sequential prompts
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:
- Create and run test cases
-
create test cases for the petstore api and run the test cases
- List draft or published APIs or products
-
list draft apis, draft products, published apis and published productsOrlist published apis
- 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 - Review security of an API
-
review security of api API_NAME:VERSIONOrvalidate api API_NAME:VERSION