Skip to main content
Glama

Validate Script

validate_script
Read-onlyIdempotent

Structurally validate a list of commands for a bot type before saving or playing, reporting any issues by command index. Pass the script's variables as well and it also cross-checks the bindings against the ${...} and bot.getVariable reads in the commands, warning about a read nothing supplies, a binding nothing reads, and a per-occurrence variable read more than once in an iteration. Warnings never make a script invalid and never stop a save — all three are legal scripts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
botTypeYesThe bot type the commands are for. HTTP is a Protocol Bot script, BROWSER is a Browser Bot script, and PLAYWRIGHT is a Playwright script. "Browser script" is ambiguous: Browser Bot and Playwright are different types, so if the user's wording doesn't say which, ask before creating.
commandsYesThe commands to validate, each a JSON object with a 'type'.
variablesNoThe script's variable bindings, as get_script returns them. Omit to skip the binding cross-check and validate structure alone.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
validYes
issuesYes
warningsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / botType / description
      Previous value: -"The bot type the commands are for."New value: +"The bot type the commands are for. HTTP is a Protocol Bot script, BROWSER is a Browser Bot script, and PLAYWRIGHT is a Playwright script. \"Browser script\" is ambiguous: Browser Bot and Playwright are different types, so if the user's wording doesn't say which, ask before creating."
  2. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Annotations only cover read-only/idempotent/non-destructive; the description adds genuinely non-obvious semantics: which three warning classes exist, that warnings never invalidate a script and never block a save, and that all three conditions are legal. That directly changes how an agent should act on the result rather than repeat annotation data.

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

Conciseness4/5

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

The core purpose and the pre-save/pre-play framing are front-loaded with no filler. The second sentence is long and the phrase "per-occurrence variable read more than once in an iteration" is dense and slightly under-explained, costing a point.

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?

With an output schema present, return values need no explanation, and the description covers the structural check, the conditional cross-check, and warning severity. It is silent on edge cases such as commands whose types don't match the supplied botType, which an agent would still have to discover.

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 botType and variables are already fully documented in the schema, including the HTTP/BROWSER/PLAYWRIGHT disambiguation and the "omit to skip the cross-check" note. The description repeats the variables behavior but adds no syntax or format detail beyond it, so baseline 3 applies.

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

Purpose4/5

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

States a specific verb (structurally validate) and resource (a list of commands for a bot type), plus the output shape (issues reported by command index). It is clearly distinct from save/play siblings, though it never names the siblings it complements (create_script, update_script, play_script) explicitly.

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?

"before saving or playing" establishes a clear usage context, and the description explains the opt-in branch: pass variables to get the binding cross-check, omit to validate structure alone. No explicit when-not guidance or named alternatives, so it stops short of a 5.

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.