Skip to main content
Glama

Get Next Workflow Step

workflow_advisor
Read-onlyIdempotent

Returns the next tool call for a multi-step workflow, given where the workflow stands. Read-only state machine; executes nothing. intent_category: build_from_accounts | account_grouping | known_assignments | realign_existing | restructure | load_part_layer | route_stops | reachable_area | periodic_scheduling | coverage_gap_analysis | points_in_territory. state: viewer_connected, point_layer, part_layer, tal_present, analysis_fresh, plus selection/realign or restructure flags. inputs: the values known so far (part_layer, territory_count, tal_id, operation, route_type, origins, visit_frequency_field, ...); missing_inputs names the keys still needed. Returns next_tool with drafted next_args, missing_inputs (reported, never invented), blocked_by, remaining_steps, and the workflow guide inline as guidance. Order rules applied: map before compute, viewer connected before compute, ingest before build, analyze after an edit when a point layer exists. Calling it after each step with the updated state walks the whole workflow.

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": {
      "intent_category": "<intent_category>"
    },
    "name": "workflow_advisor"
  }
}

Input Schema

NameRequiredDescriptionDefault
stateNoAgent-supplied workflow state; all keys optional and default to 'not done yet'.
inputsNoOptional plan parameters used to draft next_args.
intent_categoryYesbuild_from_accounts | account_grouping | point_clustering | known_assignments | realign_existing | restructure | delete_territory | load_part_layer | reachable_area | seed_growth | coverage_gap_analysis | route_stops | routes_layer | delete_route | delete_point_layer | points_in_territory | periodic_scheduling. Tool names (auto_build, account_build, cluster_points, direct_build, isochrone_build, seed_build, analyze_network_coverage) are accepted as aliases; any other value returns the unsupported-category fallback.

Output Schema

NameRequiredDescriptionDefault
okYes
errorNoPresent when ok is false.
resultNoPresent when ok is true.
warningsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changed
    • changedInput schema / properties / inputs / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": true,
      +    "properties": {
      +      "analysis_requested": {
      +        "description": "realign: opt into post-edit Analyze even without a declared point layer (AN-004).",
      +        "type": "boolean"
      +      },
      +      "assignments_handle": {
      +        "type": "string"
      +      },
      +      "balance_metric": {
      +        "type": "string"
      +      },
      +      "destination_territory_id": {
      +        "type": "string"
      +      },
      +      "grouping_field": {
      +        "type": "string"
      +      },
      +      "moves": {
      +        "description": "realign: explicit [{part_id, to_territory_id}] moves (skips map-selection steps).",
      +        "type": "array"
      +      },
      +      "new_tal_label": {
      +        "type": "string"
      +      },
      +      "new_territory_label": {
      +        "type": "string"
      +      },
      +      "operation": {
      +        "description": "restructure: which restructure tool (default rebalance).",
      +        "enum": [
      +          "split",
      +          "merge",
      +          "rebalance"
      +        ],
      +        "type": "string"
      +      },
      +      "output_mode": {
      +        "description": "For auto_build/account_build: return the default TAL or a downloadable assignments-only artifact.",
      +        "enum": [
      +          "tal",
      +          "assignments"
      +        ],
      +        "type": "string"
      +      },
      +      "part_ids": {
      +        "description": "realign: committed/explicit part ids for realign_operation.",
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "part_layer": {
      +        "type": "string"
      +      },
      +      "point_layer": {
      +        "type": "string"
      +      },
      +      "realign_operation": {
      +        "description": "realign: preset op (e.g. assign_to_territory, remove_parts).",
      +        "type": "string"
      +      },
      +      "source_tal_id": {
      +        "description": "restructure: source TAL.",
      +        "type": "string"
      +      },
      +      "tal_id": {
      +        "description": "realign: TAL to edit.",
      +        "type": "string"
      +      },
      +      "tal_label": {
      +        "type": "string"
      +      },
      +      "target_territory_id": {
      +        "description": "restructure split: territory to split.",
      +        "type": "string"
      +      },
      +      "target_workload": {
      +        "exclusiveMinimum": 0,
      +        "type": "number"
      +      },
      +      "territory_count": {
      +        "minimum": 1,
      +        "type": "integer"
      +      },
      +      "territory_id_a": {
      +        "description": "restructure merge: first territory.",
      +        "type": "string"
      +      },
      +      "territory_id_b": {
      +        "description": "restructure merge: second territory.",
      +        "type": "string"
      +      },
      +      "to_territory_id": {
      +        "description": "realign: destination territory id.",
      +        "type": "string"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / inputs / description
      Added value: +"Optional plan parameters used to draft next_args."
    • removedInput schema / properties / inputs / title
      Removed value: -"Inputs"
    • addedInput schema / properties / intent_category / description
      Added value: +"build_from_accounts | account_grouping | point_clustering | known_assignments | realign_existing | restructure | delete_territory | load_part_layer | reachable_area | seed_growth | coverage_gap_analysis | route_stops | routes_layer | delete_route | delete_point_layer | points_in_territory | periodic_scheduling. Tool names (auto_build, account_build, cluster_points, direct_build, isochrone_build, seed_build, analyze_network_coverage) are accepted as aliases; any other value returns the unsupported-category fallback."
    • changedInput schema / properties / state / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": true,
      +    "properties": {
      +      "analysis_fresh": {
      +        "type": "boolean"
      +      },
      +      "analysis_panel_loaded": {
      +        "type": "boolean"
      +      },
      +      "analysis_requested": {
      +        "description": "realign: user explicitly requested post-edit analysis; otherwise geography-only realign stops after the live map refresh.",
      +        "type": "boolean"
      +      },
      +      "expected_revision": {
      +        "description": "realign: optimistic-concurrency revision.",
      +        "type": [
      +          "integer",
      +          "null"
      +        ]
      +      },
      +      "headless": {
      +        "type": "boolean"
      +      },
      +      "map_session_id": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "part_layer": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "point_layer": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "realign_applied": {
      +        "description": "realign: the realign mutation completed.",
      +        "type": "boolean"
      +      },
      +      "selection_committed": {
      +        "description": "realign: parts committed on the map.",
      +        "type": "boolean"
      +      },
      +      "selection_requested": {
      +        "description": "realign: a request_part_selection task exists.",
      +        "type": "boolean"
      +      },
      +      "selection_task_id": {
      +        "description": "realign: id to poll with get_part_selection.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "source_tal_id": {
      +        "description": "restructure: source TAL.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "tal_id": {
      +        "description": "realign: TAL being edited.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "tal_present": {
      +        "type": "boolean"
      +      },
      +      "ts_handle": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "user_id": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "viewer_connected": {
      +        "type": "boolean"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / state / description
      Added value: +"Agent-supplied workflow state; all keys optional and default to 'not done yet'."
    • removedInput schema / properties / state / title
      Removed value: -"State"
    • removedOutput schema / additionalProperties
      Removed value: -true
    • addedOutput schema / properties
      Added value: +{
      +  "error": {
      +    "description": "Present when ok is false.",
      +    "properties": {
      +      "ask_user": {
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "code": {
      +        "type": "string"
      +      },
      +      "details": {
      +        "type": "object"
      +      },
      +      "do_this_next": {
      +        "type": "object"
      +      },
      +      "message": {
      +        "type": "string"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "ok": {
      +    "type": "boolean"
      +  },
      +  "result": {
      +    "description": "Present when ok is true.",
      +    "properties": {
      +      "blocked_by": {
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "build_tool": {
      +        "type": [
      +          "null",
      +          "string"
      +        ]
      +      },
      +      "done": {
      +        "type": "boolean"
      +      },
      +      "guidance": {
      +        "type": [
      +          "null",
      +          "object"
      +        ]
      +      },
      +      "guidance_uri": {
      +        "type": "string"
      +      },
      +      "intent_category": {
      +        "type": "string"
      +      },
      +      "invariants_enforced": {
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "missing_inputs": {
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "next_args": {
      +        "type": "object"
      +      },
      +      "next_tool": {
      +        "type": [
      +          "null",
      +          "string"
      +        ]
      +      },
      +      "note": {
      +        "type": "string"
      +      },
      +      "remaining_steps": {
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "supported": {
      +        "type": "boolean"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "warnings": {
      +    "items": {
      +      "properties": {
      +        "code": {
      +          "type": "string"
      +        },
      +        "message": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "type": "array"
      +  }
      +}
    • addedOutput schema / required
      Added value: +[
      +  "ok"
      +]
    • removedOutput schema / title
      Removed value: -"workflow_advisorDictOutput"
  2. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the read-only/idempotent annotations, the description discloses that the tool never invents missing inputs, reports blocked_by, applies ordering rules (map before compute, viewer before compute, ingest before build, analyze after edit when a point layer exists), and returns drafted next_args plus remaining steps. These are substantive behavioral traits an agent needs to trust the routing output.

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 description is front-loaded with the core purpose and then supplies dense operational detail. It is somewhat long and repeats intent categories and state keys already covered by the schema, but the ordering rules and missing-inputs behavior earn their place.

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

Completeness5/5

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

For a high-complexity state-machine advisor with a rich input schema, full annotations, and an output schema, the description covers purpose, usage cadence, behavioral rules, and return shape. An agent has enough context to call it correctly and interpret the response without needing additional prose.

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 the baseline is 3. The description adds some high-level meaning for state and inputs, and mentions input keys like route_type, origins, and visit_frequency_field that are not explicitly listed in the schema. But its intent_category list is incomplete relative to the schema and omits aliases, so it does not meaningfully outperform the already detailed schema.

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 first sentence states a specific verb and resource: 'Returns the next tool call for a multi-step workflow, given where the workflow stands.' It immediately distinguishes itself from execution tools by declaring 'Read-only state machine; executes nothing.' An agent can tell this is a routing/advisor tool, not a sibling that performs builds, analyses, or mutations.

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 makes the usage pattern explicit: call it after each step with updated state to walk the whole workflow. It also implies the boundary that this tool does not execute anything, so actual actions must be taken by the returned tool. However, it does not explicitly name an alternative or say when not to use it, which keeps it just 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.

Resources