Skip to content

Commit c287e04

Browse files
Add step-authoring actions: headers, variables, and scripts (#29)
* Fix missing return for unsupported body_type in add_body_to_step An unsupported body_type constructed the error BaseResult but did not return it, so execution fell through and PUT the step with an empty body and no Content-Type header. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S2Ym1SshabyXjWNdeGFDfx * Fix copy-pasted error message in add_assertion_to_step The non-request-step guard reported "cannot have a body added" when rejecting an assertion. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S2Ym1SshabyXjWNdeGFDfx * Emit Content-Type header values as arrays in add_body_to_step The REST API documents header values as arrays of strings (e.g. {"Content-Type": ["application/json"]}); bare strings relied on undocumented server leniency. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S2Ym1SshabyXjWNdeGFDfx * Add step authoring actions: headers, variables, and scripts New actions on the steps tool, following the existing read-modify-PUT mutation pattern with the request-step guard: - add_headers_to_step: merge request headers into an existing step. Values are normalized to arrays per the REST API contract; a new header replaces an existing one whose name matches case-insensitively. - add_variable_to_step: append an extraction variable ({name, source, property}) for passing response values to later steps. Source is validated against the documented enum and property is required for header/JSON/XPath sources. - add_script_to_step: append a pre-request (before_scripts) or post-response (scripts) JavaScript snippet, control-char sanitized. add_request_step now accepts optional headers and note so a complete step can be created in a single POST. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S2Ym1SshabyXjWNdeGFDfx * Document new step-authoring capabilities in README Reflect the headers, variables, scripts, and note support added to the steps tool: the Test Step Management use-case list and the blazemeter_apitest_steps tool summary previously described only Pause/Request creation with Body and Assertions. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S2Ym1SshabyXjWNdeGFDfx * Address Copilot review: validate note type, scope variable_property - add_request_step: reject non-string note with a clear validation error instead of falling through to the generic unexpected-error; strip the sanitized note. - add_variable_to_step: validate variable_property is a string when provided, strip it, treat whitespace-only as missing, and only send "property" for sources that require it (dropped for response_status and response_text, matching the tool contract). - Docstring: note must be a string; variable_property is ignored for sources that do not use it. - Tests: 5 new cases covering the above. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ULzi7DRzKEuqaSEiJf3Few --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 48a7b49 commit c287e04

3 files changed

Lines changed: 733 additions & 15 deletions

File tree

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ This gives AI agents, assistants, and chatbots the ability to read and manage te
3434
**Test Step Management**
3535
- List all steps within a test to understand its workflow and structure.
3636
- Retrieve a single step’s details to inspect API request/response configuration, conditions, and validations.
37-
- Create a new test step (Pause or Request) to modify or extend test workflows.
37+
- Create a new test step (Pause or Request), optionally with headers and a note set in the same call, to modify or extend test workflows.
38+
- Add or update request headers, and attach a JSON, XML, HTML, or text body to a request step.
39+
- Extract values from a response into variables, and add pre-request or post-response scripts, to chain data between steps.
40+
- Add assertions to a step to validate response status, timing, size, or body content.
3841

3942
> [!NOTE]
4043
> **For detailed documentation including use cases, available tools, integration points, and troubleshooting, see the [BlazeMeter API Test MCP Server documentation](https://help.blazemeter.com/docs/guide/integrations-api-monitoring-mcp-server.html).**
@@ -230,7 +233,7 @@ The BlazeMeter API Test MCP Server provides the following tools for interacting
230233
- `blazemeter_apitest_buckets`: List all the buckets, Read bucket details, and Create a new bucket.
231234
- `blazemeter_apitest_tests`: List all API tests within a bucket, Read test details, Create a new API test, and Get the test metrics.
232235
- `blazemeter_apitest_schedules`: List all schedules within a test, Read schedule details, and Create a new schedule.
233-
- `blazemeter_apitest_steps`: List all steps within a test, Read test step details, and Add a new Pause and Request step( with URL, Method, Body and Assertions) to a test.
236+
- `blazemeter_apitest_steps`: List all steps within a test, Read test step details, Add a new Pause or Request step (with URL, Method, Headers, and Note), and add a Body, Assertion, Header, extraction Variable, or pre/post Script to an existing request step.
234237
- `blazemeter_apitest_environments`: List all test environments, and Read test environment details.
235238
- `blazemeter_apitest_results`: Execute an individual test or all bucket-level tests, List last 50 test results, and Read test result and bucket-level result details.
236239

0 commit comments

Comments
 (0)