Skip to main content
Glama

Modify Request

modify_request

Partially update request files, changing only supplied fields (URL, method, headers, body, scripts, auth, settings) while preserving others. Supports file uploads and script replacement.

Instructions

Update an existing Bruno request file with partial-merge semantics. Only provided fields are updated; all other fields are preserved. Supports multipart/form-data with file uploads and per-part contentType. Inline scripts REPLACE the existing script of the same type by default (idempotent — repeated calls do not accumulate duplicate blocks); pass scriptMode:"append" to concatenate instead. Use remove_script to clear a script entirely.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNo
authNo
bodyNo
nameNo
varsNo
queryNo
assertNoReplaces the whole assert block. Omit to leave existing assertions untouched.
methodNo
headersNo
scriptsNoInline scripts to persist with the request. Keys: pre-request, post-response, tests (aliases before-request/after-response accepted). Avoids a separate add_test_script call. IMPORTANT for tests/post-response: only assertions inside a test() block are reported. Write test("status is 200", function() { expect(res.getStatus()).to.equal(200); }); — a bare expect() at the top level still runs, but a passing one records nothing, so run_collection reports "tests": [] and the request looks green with no assertions. Available in scripts: res.getStatus()/getStatusText()/getHeader(name)/getHeaders()/getBody()/getResponseTime(), bru.setVar(name, value)/getVar(name), and expect(actual) with .to.equal/.contain/.include, .to.have.property/.lengthOf, .to.be.a/.an, .to.be.above/.below/.at.least/.at.most (aliases .gt/.lt/.gte/.lte/.greaterThan/.lessThan), .to.be.within(min, max), .to.be.oneOf([...]), .to.match(/re/), .to.startWith/.endWith, .to.be.true/.false/.null/.undefined/.empty/.json,and .to.not.* negations. RETURN TYPE: res.getBody() returns the response already parsed into a JS object/array when the Content-Type is application/json or a +json type (raw text otherwise). Access fields directly — res.getBody().field — and do NOT JSON.parse() it, which throws SyntaxError: "[object Object]" is not valid JSON.
filePathYesAbsolute path to the .yml or .bru request file to modify. Get from list_requests or get_collection_stats.
settingsNoRequest-level settings: transport behaviour (timeouts, redirects, URL encoding), not payload. What reaches the file depends on the dialect, because Bruno's own two writers differ: a .yml request always carries a fully resolved settings block whether or not you pass one, while a .bru request carries only what you supply. On modify_request the fields are merged individually over the existing block, so setting one does not clear the rest. Note the encodeUrl field: in .bru, creating a block at all changes the URL-encoding default.
pathParamsNoReplaces the declared path parameters; query parameters are left alone.
scriptModeNoHow to write the scripts field. "replace" (default) overwrites the existing script of each provided type, so calling modify_request repeatedly is idempotent. "append" concatenates onto the existing script, which accumulates blocks across calls. Each script type has its own slot in both .bru and .yml, so replacing one leaves the others untouched. One exception on .yml: supplying post-response and tests together in a single call still merges both into the after-response slot, so write the tests script in its own call to keep it in the tests slot.replace
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden and does disclose key traits: partial-merge (only provided fields updated), idempotent script replacement (repeated calls do not accumulate), and multipart support. It doesn't mention edge-case side effects like the encodeUrl default or .bru/.yml dialect differences, but the core behavioral profile is clearly communicated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single front-loaded paragraph, four sentences, with no fluff. Every sentence carries meaning: purpose/merge semantics, multipart capability, script replacement behavior, and an alternative tool reference.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is complex (14 params, nested objects, no output schema) and the description covers core semantics but leaves many parameter behaviors unaddressed. The schema provides detail for some parameters, but with 43% coverage and no output schema, the overall definition is not fully complete for an agent to use correctly in all scenarios.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 43%, so the description must compensate, but it only details scripts, multipart, and scriptMode. Parameters like auth, vars, query, method, headers, settings, and pathParams lack coverage in both the description and the schema, leaving gaps. The description adds some value for the covered params but does not fully compensate for the low coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with 'Update an existing Bruno request file with partial-merge semantics', a specific verb+resource that clearly states what the tool does. It distinguishes from siblings by detailing script replacement behavior and pointing to remove_script for clearing scripts entirely, so it is clearly not create_request or delete_request.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context that this tool updates existing files (not creates them) and explicitly says 'Use remove_script to clear a script entirely', offering an alternative. It doesn't enumerate all alternatives like add_test_script, but the schema adds that hint, and the partial-merge semantics imply when to prefer this over other editors.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Ostico/bruno-mcp-studio'

If you have feedback or need assistance with the MCP directory API, please join our Discord server