Skip to main content
Glama

Switch workspace

well_switch_workspace

Write this connection's session context — the one place a conversation's standing choices live. This is the tool the widget cards call when the user CLICKS them: the workspace pin and queue, the selected months, the selected counterparties, and the step acknowledgements are all recorded here, and every later tool call defaults to them.

Pass any of:

  • workspace_ids (ordered list): the workspaces to work in. The FIRST entry becomes the pin and the rest the workspace_queue to work through next. Every id must be one this connection is already authorized for — call well_list_workspaces to see them. This grants no new access; it only chooses among the authorized workspaces.

  • periods: the months the user VALIDATED on the period card ({ calendar_year, calendar_month } each). Period-scoped reads (well_list_missing_invoices, well_preview_invoice_fetch) default to them when called without a period. Send it only for the user's month selection — never to bound a counterparty pick, which would overwrite that selection.

  • counterparties: the counterparties (vendors) the user selected, each { company_id, matched_connector_service_id }. Copy both ids off the row you listed them from; pass no display name. The selection belongs to the workspace this call is dispatched to, and a switch to another workspace clears it. One session holds one selection, so a new one replaces it; a selection sent for a workspace this connection has switched away from is REFUSED instead, so a card the flow moved past cannot overwrite the pinned workspace's selection.

  • counterparty_periods: the months the counterparties card listed, sent alongside counterparties. The pick then narrows those months only, and a month it never covered is read in full. With none named, the months this session already holds bound the pick. This never becomes the session's selected months.

  • ack: "connectors" or "bank" — records that the user confirmed that flow step, in the workspace this call is dispatched to. A switch to another workspace clears it, so the next workspace's card asks for its own click. An acknowledgement sent for a workspace this connection has switched away from is REFUSED instead, so a card the flow moved past cannot un-confirm the step the pinned workspace's own card recorded.

Call it with NO argument at all to pin the workspace this call itself is dispatched to — its universal workspace_id, or the only workspace the token covers. workspace_ids is the PIN write and nothing else: it moves the pin AND replaces the workspace_queue, so a one-entry list ends a run that still had workspaces queued. Send it only to change the workspace. A call carrying periods, counterparties or ack needs no workspace_ids: its universal workspace_id targets that one call, and the pin and the queue stay where they are. Never re-pin the workspace this connection already holds.

Every provided input is applied, and changed names the session fields this call wrote. After a switch, every later call that omits workspace_id targets the pinned workspace, for reads and writes alike; passing workspace_id on a later call overrides it for that call only. well_list_workspaces reports the current session context, and well_wait_for_selection reads a card click back — instantly when it already landed here, after a short wait otherwise.

This changes nothing in the user's data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ackNoAcknowledge a flow step: "connectors" for the connect-tools step, "bank" for the bank step. The acknowledgement is scoped to the workspace this call is dispatched to, and a switch to another workspace clears it. An acknowledgement sent for a workspace this connection has switched away from is refused, and the pinned workspace's own acknowledgement of that step stands.
periodsNoThe months the user VALIDATED on the period card, stored as this session's selected_periods. Later period-scoped reads default to them when called without a period. This field is the user's month selection alone — to bound a counterparty pick, send counterparty_periods instead.
workspace_idNoTarget workspace. Omit when the token authorizes one workspace. Required when it authorizes several — a write lands in exactly one workspace and this call would not say which.
workspace_idsNoOrdered workspace selection, and the ONLY field that moves the pin: the FIRST entry becomes this connection's pin, and the rest REPLACE the workspace_queue — so a one-entry list empties a queue that still holds workspaces. Every entry must be authorized for this connection, or the whole call is refused. Never send it to name the workspace of a periods, counterparties or ack call: the universal workspace_id already targets those, while a re-pin to the id this connection already holds writes nothing and clears the queue.
counterpartiesNoThe counterparties the user selected, stored as this session's selected_counterparties and scoped to the workspace this call is dispatched to. At most 200 — a longer list is refused, so a select-all keeps to that bound. Copy the ids off the row: company_id, plus matched_connector_service_id when the row carries one. Send the card's months as counterparty_periods in the same call, so the pick applies to those months only; with none named, the months this session already holds bound it. The session holds ONE selection, so this REPLACES the previous one — but only when the call names the pinned workspace: a selection sent for a workspace this connection has switched away from is refused, and the pinned workspace's selection stands.
idempotency_keyNoOptional client-supplied key. A retried write with the same key returns the original result instead of re-applying the operation.
counterparty_periodsNoThe months the counterparties card listed, which bound the pick sent as counterparties in the same call. Send it only with counterparties; it never becomes this session's selected months, so it cannot overwrite what the user validated on the period card. With none named, the months this session already holds bound the pick.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
changedNoWhich session fields this call wrote.
successYes
acknowledgedNo
workspace_idNo
workspace_nameNo
workspace_queueNoThe workspaces queued after the pinned one, in order.
selected_periodsNo
selected_counterpartiesNo

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the annotations (readOnly=false, destructive=false), it clarifies that the write touches session context only ('This changes nothing in the user's data'), explains pin/queue replacement, stale-workspace refusals, and acknowledgement clearing on switch. No contradiction with annotations.

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 long and occasionally repeats the scoping phrase 'the workspace this call is dispatched to,' but it is front-loaded, organized by parameter, and each section covers a distinct behavioral edge case. The complexity of the tool justifies most of the length.

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 stateful 7-parameter tool, the description covers the no-argument call, universal workspace targeting, auth constraints, the changed return field, and links to reporting/reading siblings. With full schema and an output schema present, nothing needed to invoke correctly is missing.

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

Parameters5/5

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

Schema coverage is 100%, but the description adds substantial cross-parameter meaning: the first workspace_ids entry becomes the pin while the rest replace the queue, counterparty_periods never becomes the session's selected months, and ack/counterparties are scoped to the dispatched workspace. This goes well beyond the schema field descriptions.

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 'Write this connection's session context' and enumerates exactly what gets recorded: workspace pin/queue, months, counterparties, and step acknowledgements. This is a specific verb+resource and clearly distinguishes the tool from sibling read/list tools.

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?

It states when the tool fires ('the tool the widget cards call when the user CLICKS them'), when to omit args entirely, and gives explicit exclusions: 'Send it only to change the workspace,' 'Never re-pin the workspace this connection already holds,' and 'never to bound a counterparty pick.' It also names well_list_workspaces as the way to see authorized workspaces.

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.

TDQS

A4.5/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: CRUD for companies, people, and invoices; financial analytics (cash, cost, runway, holdings); connector management and invocation; schema discovery; querying; reconciliation; and contact channel management. No two tools could be confused for the same action.

Naming Consistency5/5

All tools follow the `well_verb_noun` pattern with consistent verb choices (create, get, list, update, delete, add, remove, run, resolve, query, invoke). The naming is predictable and makes the tool's purpose immediately clear.

Tool Count4/5

With 26 tools, the set is slightly above the ideal 3-15 range, but every tool earns its place given the breadth of the domain (CRM, invoicing, financial analytics, reconciliation, connector management). The count is well-scoped and not excessive.

Completeness4/5

The tool surface covers core CRUD, financial KPIs, reconciliation, and connector management. Minor gaps exist (e.g., no direct tool to update contact channels or manage accounts), but the query and schema tools allow agents to work around them, and the primary workflows are fully supported.

Resources