contract-testing_generate_pact_tests
Generate Pact tests using PactFlow AI. You can provide one or more of the following input types: (1) request/response pairs for specific interactions, (2) code files to analyze and extract interactions from, and/or (3) OpenAPI document to generate tests for specific endpoints. When providing an O...
This record as markdown: /tools/smartbear-mcp/contract-testing-generate-pact-tests.md
What contract-testing_generate_pact_tests does on SmartBear MCP
AI agents invoke contract-testing_generate_pact_tests to trigger actions in SmartBear MCP. What it does depends on the arguments the agent supplies, and its effects often reach beyond the immediate call: builds kicked off, notifications sent, workflows started.
| Parameter | Type | Required | Description |
|---|---|---|---|
code | array | — | Collection of source code files to analyze and extract API interactions from. Include client code, data models, existing tests, or any code that makes API calls |
openapi | object | — | If provided, the OpenAPI document which describes the API being tested and is accompanied by a matcher which will be used to identify the interactions in the Op |
language | string | — | Target language for the generated Pact tests. If not provided, will be inferred from other inputs. |
testTemplate | object | — | Optional test template to use as a basis for generation. Helps ensure generated tests follow your specific patterns, frameworks, and coding standards |
requestResponse | object | — | Direct request/response pair for a specific interaction. Use this when you have concrete examples of API requests and responses |
additionalInstructions | string | — | Optional free-form instructions to guide the generation process (e.g., 'Focus on error scenarios', 'Include authentication headers', 'Use specific test framewor |
Parameters from the server's own tool schema.
Why contract-testing_generate_pact_tests is rated High
This tool triggers an AI-powered code generation process (executing PactFlow AI) that produces test code from inputs like OpenAPI documents and code files. It runs an external operation (AI inference/generation) and produces output artifacts. It's not purely reading existing data, nor writing user data reversibly in a simple sense — it executes a generation pipeline.
From the tool's definition Generate Pact tests using PactFlow AI... analyze and extract interactions from... generate tests for specific endpoints
Risk signalsAccepts file system path (requestResponse.request.filename) · Accepts raw HTML/template content (requestResponse.request.body) · Accepts freeform code/query input (code) · Accepts URL/endpoint input (openapi.remoteDocument.url) · High parameter count (34 properties)
Attacks that exploit this kind of access
The rule that runs contract-testing_generate_pact_tests safely
PolicyLayer is an MCP gateway: it sits between your AI agents and SmartBear MCP, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For contract-testing_generate_pact_tests, this is the rule to start with:
contract-testing_generate_pact_tests stays usable, but rate-capped: a runaway agent can't fire it dozens of times a minute. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect SmartBear MCP, apply this rule, and every contract-testing_generate_pact_tests call is checked against it from then on.
Questions about contract-testing_generate_pact_tests
Generate Pact tests using PactFlow AI. You can provide one or more of the following input types: (1) request/response pairs for specific interactions, (2) code files to analyze and extract interactions from, and/or (3) OpenAPI document to generate tests for specific endpoints. When providing an OpenAPI document, a matcher is required to specify which endpoints to generate tests for. Parameters: - language (enum): Target language for the generated Pact tests. If not provided, will be inferred from other inputs. - requestResponse (object): Direct request/response pair for a specific interaction. Use this when you have concrete examples of API requests and responses - code (array): Collection of source code files to analyze and extract API interactions from. Include client code, data models, existing tests, or any code that makes API calls - openapi (any) - additionalInstructions (string): Optional free-form instructions to guide the generation process (e.g., 'Focus on error scenarios', 'Include authentication headers', 'Use specific test framework patterns') - testTemplate (object): Optional test template to use as a basis for generation. Helps ensure generated tests follow your specific patterns, frameworks, and coding standards. It is categorised as a Execute tool in the SmartBear MCP MCP Server, which means it can trigger actions or run processes. Use rate limits and argument validation.
contract-testing_generate_pact_tests accepts 6 parameters: code, openapi, language, testTemplate, requestResponse, additionalInstructions. The full parameter table on this page comes from the server's own tool schema.
Register the SmartBear MCP server in PolicyLayer and add a rule for contract-testing_generate_pact_tests: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches SmartBear MCP. Nothing to install.
contract-testing_generate_pact_tests is a Execute tool with high risk. Execute tools should be rate-limited and have argument validation enabled.
Yes. Add a rate_limit block to the contract-testing_generate_pact_tests rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for contract-testing_generate_pact_tests. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
contract-testing_generate_pact_tests is provided by the SmartBear MCP server (SmartBear/smartbear-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on SmartBear, and thousands of servers like it.
Across the catalogue