Skip to main content
Glama

Compose a workflow in a session

writ_browser_compose
Destructive

Authors the workflow in an open session beyond a recording: named API functions (define_function with a flow, preferred in an API build, or a captured call's index or a lists payload; live-tested as defined; compile_function for an authenticated request), set_inputs, add_steps, test_function, remove_function, remove_step, list. A flow is built in small calls: define_function with its first request, then add_flow_step {function, step, at?} per step, each tested and answered with the step list; a set step's value is read as {ref:'vars.'}. Shapes: writ_help('writ_browser_compose').

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "session_id": "<session_id>",
      "operation": "<operation>"
    },
    "name": "writ_browser_compose"
  }
}

Input Schema

NameRequiredDescriptionDefault
payloadNoThe operation's arguments; add_flow_step: {function, step, at?}, remove_flow_step: {function, at}.
operationYesThe action; add_flow_step, replace_flow_step and remove_flow_step change one step of a function's flow.
session_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / operation / description
      Previous value: -"list | define_function | compile_function | test_function | remove_function | add_steps | remove_step | set_inputs."New value: +"The action; add_flow_step, replace_flow_step and remove_flow_step change one step of a function's flow."
    • changedInput schema / properties / operation / enum
      Previous value: -[
      -  "list",
      -  "define_function",
      -  "compile_function",
      -  "test_function",
      -  "remove_function",
      -  "add_steps",
      -  "remove_step",
      -  "set_inputs"
      -]New value: +[
      +  "list",
      +  "define_function",
      +  "compile_function",
      +  "test_function",
      +  "remove_function",
      +  "add_flow_step",
      +  "replace_flow_step",
      +  "remove_flow_step",
      +  "add_steps",
      +  "remove_step",
      +  "set_inputs"
      +]
    • changedInput schema / properties / payload / description
      Previous value: -"The operation's arguments."New value: +"The operation's arguments; add_flow_step: {function, step, at?}, remove_flow_step: {function, at}."
  2. Changed3 schema fields changed
    • addedInput schema / properties / operation / description
      Added value: +"list | define_function | compile_function | test_function | remove_function | add_steps | remove_step | set_inputs."
    • changedInput schema / properties / payload / description
      Previous value: -"The operation's arguments. define_function: {name, fn_type?, description?, surface?, from_index?, request?{method,url,headers,body_template}, flow?{version,steps}, script?, selector?, input_variables?, output_fields?, response_extractions?, is_auth?, order?, sample_inputs?, test?}. compile_function {name, from_index, sibling_index?, input_variables?, response_extractions?, page_url?}: the deterministic (no-LLM) way to turn a captured authenticated request (a GraphQL/RPC POST, a form submit) into a callable function. Writ decodes the body, keeps the static parameters, traces each session-minted token (csrf/xsrf/dtsg/lsd/etc.) to where a fresh session re-reads it and emits an is_auth bootstrap that publishes it as {{extracted:}}/{{cookie:}}, replaces per-call client values (idempotence token, session id, timestamp) with runtime generators ({{uuid()}}, {{uuid(session)}}, {{timestamp_ms()}}, {{counter()}}), templates the caller inputs, and classifies a write (create/post/send/delete): the build never sends it, a real run does (mutation_mode='dry_run' previews it). It suits any authenticated mutation or token-bound endpoint better than a hand-built api function. A second capture of the same request (sibling_index, else the nearest one Writ finds) tells the pagination inputs and per-call values from stable ids: a UUID unchanged between the two is kept as captured. test_function: {name, sample_inputs?}. remove_function: {name}. add_steps: {steps:[{type, config|flat fields, description?}], at?}. remove_step: {id}. set_inputs: {inputs:{name:{default?, description?, required?, example?}}}."New value: +"The operation's arguments."
    • removedInput schema / properties / session_id / description
      Removed value: -"Session id from the start tool."
  3. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, openWorldHint=true and idempotentHint=false, so the safety profile is covered. The description adds meaningful behavior beyond that: functions are 'live-tested as defined' and each flow step is 'tested and answered with the step list', which tells the agent these calls have side effects and return state, even with no output schema.

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

Conciseness3/5

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

The purpose is front-loaded, but the long parenthetical enumerating operations is hard to parse and packs multiple ideas into one clause. It is information-dense rather than wasteful, yet structure could be improved with a short bulleted mapping of operation to purpose.

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-operation destructive tool with nested payloads and no output schema, the description covers the main workflow (define, add steps, test, remove) and points to writ_help('writ_browser_compose') for full shapes. The main residual gap is that per-operation return values are only partly described.

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

Parameters4/5

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

With 67% schema coverage, the description does useful extra work: it explains what define_function and compile_function mean, gives the add_flow_step payload shape, and clarifies that a set step's value is read as {ref:'vars.<name>'} — a detail absent from the schema. The payload semantics for the other operations (add_steps, set_inputs, replace_flow_step) remain only partially covered.

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?

The opening clause states a specific verb and resource: 'Authors the workflow in an open session beyond a recording,' which cleanly separates it from the recording-related siblings. The following enumeration of operations is dense, but the core purpose is unambiguous.

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?

It gives real routing guidance at the operation level, e.g. define_function with a `flow` is 'preferred in an API build' and compile_function is for an authenticated request. It also prescribes a build sequence (define_function first, then add_flow_step per step), though it says nothing about when to choose this tool over writ_update_workflow or writ_create_automation.

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.