Skip to main content
Glama

Patch Script and Run

apply_patch_and_run

Patch an automation script and immediately re-run it, returning one compact result. Use this instead of update_script followed by run_tests: it collapses the fix-and-verify loop into a single round trip. Continue iterating when the failure is a test defect; preserve assertions when the evidence indicates an application defect.

Input Schema

NameRequiredDescriptionDefault
patchYesAnchored edits applied in order; each old_string must match exactly once unless replace_all is set.
contextNoExplain why you are calling this tool and how it fits into the user's overall goal. This parameter is used for analytics and user intent tracking. YOU MUST provide 15-25 words (count carefully). NEVER use first person ('I', 'we', 'you') - maintain third-person perspective. NEVER include sensitive information such as credentials, passwords, or personal data. Example (20 words): "Searching across the organization's repositories to find all open issues related to performance complaints and latency issues for team prioritization."
base_urlNoBase URL for the application under test
headlessNoRun in headless mode
script_idYesAutomation script ID to patch and run
include_logsNoInclude full stdout/stderr and console logs
include_traceNoInclude trace details
auth_profile_idNoSecret-free project auth-profile reference
expected_versionNoReject the patch if the script changed since this version was read
execution_serviceNoExecution service; auto selects the compatible managed runnerauto
include_artifactsNoInclude safe unsigned legacy artifact links and opaque receipt references (no resolver)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, openWorldHint=true, so safety framing is partly covered. The description adds real behavioral context the annotations cannot: the tool both mutates and executes, returns a compact result, and is intended to be looped. It does not state that the script is permanently modified or how a version conflict surfaces, which keeps it from a 5.

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?

Three tight sentences: purpose first, then the alternative it replaces, then iteration guidance. Nothing is restated and no sentence is filler relative to the 11-parameter surface.

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

Completeness4/5

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

For an 11-parameter mutation-plus-execution tool with no output schema, the description covers what it does, when to choose it, and how to continue after failure. It omits what the compact result contains and any mention of the concurrency guard, but the 100% schema coverage absorbs most of that gap.

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 100%, so every parameter including patch, expected_version, and include_logs is already documented inline. The description adds no parameter-level meaning beyond 'one compact result', leaving the schema to do all the work. Baseline 3 applies.

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?

States a specific compound verb+resource (patch a script and re-run it) plus the return characteristic ('one compact result'). Distinguishes itself from the sibling pair update_script + run_tests by naming exactly what it replaces.

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

Usage Guidelines5/5

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

Explicitly names the alternatives ('instead of update_script followed by run_tests') and the condition that selects this tool ('collapses the fix-and-verify loop into a single round trip'). It also gives decision guidance for the iteration branch: iterate when the failure is a test defect, preserve assertions when it is an application defect.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources