Skip to main content
Glama

Create the company workspace

well_create_company_workspace
Idempotent

Create the company workspace from a candidate, the step that turns a picked company into a workspace the close runs in. This anchors the candidate's company as the new workspace's own company and links it to the membership it was created under.

REQUIRED: candidate_id — from well_create_company_candidate. This mints the child workspace, projects its accounting settings from the country defaults, anchors its own company, and writes the lineage row, so well_switch_workspace can move into it in the same conversation. Idempotent: calling it again on the same candidate returns the same child, with already_anchored true.

OPTIONAL, the person's two answers: bring_company_data (true brings the company's history into its workspace: its documents, tasks, transactions and accounts) and move_connectors (true moves the person's bank and accounting connections into the company workspace). Before calling, confirm the company with the person and ask both questions: bring its history (default yes) and move the bank and accounting connections (the card shows it on by default). Pass each answer as true or false exactly as the person gave it, and ask again when an answer is unclear. Omitting move_connectors records "do not move": the connections move only when the person says yes, through the card or in the chat. Omitting bring_company_data means true.

After a successful mint, history reports the stored history choice and preview counts, and connector_move reports the stored connector-move state. Tell the person with these sentences only, translated when they write in another language, and never write a field name, a state or refusal literal, an id or a unit count. history.brought false: "The company's earlier items stay where they are, and nothing was brought into the new workspace." true with counts null: "The company's earlier documents, tasks, transactions and accounts are being linked to the new workspace." true with counts: "N documents, N tasks, N transactions and N accounts will be linked to the new workspace." (more than N when capped; "are linked" only when adoption_status is complete). connector_move.state armed: "Your bank and accounting connections are being moved to the new workspace, and this takes a while." nothing_to_move: "There are no bank or accounting connections to move." pending: "The move of your bank and accounting connections is being set up." refused, whatever the refusal: "Your bank and accounting connections stay where they are, because Well could not move them." not_requested or null: no sentence.

OPTIONAL: existing_workspace_id — when well_get_own_company returned it on the candidate, the person already has a workspace for that company. Pass the id and this call attaches that workspace under this one instead of minting a duplicate: with relation child it already sits under this workspace, with relation top_level it is linked under it. The two answers still apply: the stored choice keeps or brings the history, and the move runs after the call, never before it. Never invent or reuse an id the read did not return; a candidate that carries none mints as before, and one whose offer is stale is refused rather than duplicated.

Only a workspace owner or admin may create the company workspace. A caller without that role is refused, not silently ignored. Confirm the company with the user before calling.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
candidate_idYesThe candidate id returned by well_create_company_candidate.
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.
conversation_idNoThe conversation id returned by the previous Well result, in its meta under well/conversation_id, in its structuredContent, or in its JSON text block. Pass it back on every call in the same conversation, including a call a card makes, so the chosen workspace and the earlier answers still apply. It decides the conversation on its own: nothing the host states about the session replaces it. Omit it only on the first call of a conversation.
idempotency_keyNoOptional client-supplied key. A retried write with the same key returns the original result instead of re-applying the operation.
move_connectorsNoThe person's answer to: move your bank and accounting connections into the company workspace? true moves them, false keeps them where they are. Ask first. Omitting records false: nothing moves unless the person opted in.
workspace_scopeNoRestrict this call to the family: the token's primary workspace plus the company workspaces under it that you are a member of. Unrelated authorized workspaces drop out of the read; row reads merge across the family, while a per-workspace figure still reports exactly one workspace.
bring_company_dataNoThe person's answer to: bring the company's history into its workspace (documents, tasks, transactions and accounts)? true brings it, false leaves it. Omit only when the person was not asked; omitting means true.
existing_workspace_idNoThe existing workspace's id when well_get_own_company returned one on this candidate: the person already has a workspace for that company, and passing the id attaches it under this one instead of minting a duplicate. Never pass an id the read did not return; leave it out for any candidate that carries none.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoThe company workspace's name, derived from the candidate.
errorNo
historyNoThe stored history choice and the pre-mint counts of items that will be linked.
successYes
workspace_idNoThe created (or existing) company workspace's id.
connector_moveNoThe stored connector-move intent and its derived state; only armed means connections are moving.
own_company_idNoThe public id of the company anchored as the workspace's own.
conversation_idNoThe conversation this result belongs to. Pass it back as the conversation_id argument on every later Well call in the same conversation.
newly_connectedNoTools that connected to this workspace since the last result and that no session was told about yet, oldest first. Present only when at least one tool is new. The connected-line rule says when to tell an entry; when it does, one line per entry, in the person's language: "<name> is connected.". Never fold several entries into one sentence. Each entry comes back once, on one result only: never repeat its line later.
already_anchoredNoTrue when this call did not mint a fresh workspace: the candidate had already minted its child (a converged replay) or resolved to a company already anchored on the caller. The same child is returned either way.
conversation_id_noteNoPresent only when the server opened a fresh lane, stating that no choice recorded earlier was read.
conversation_id_sourceNoWhere the conversation id came from: the host's own request meta, the caller's argument, or a fresh lane the server opened.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / connector_move
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "armed": {
      +          "type": "boolean"
      +        },
      +        "country_mismatch": {
      +          "type": "boolean"
      +        },
      +        "refusal": {
      +          "anyOf": [
      +            {
      +              "enum": [
      +                "move_not_available",
      +                "requester_unknown",
      +                "own_company_missing",
      +                "movable_set_over_cap",
      +                "no_lineage",
      +                "no_child_owner",
      +                "no_parent_admin"
      +              ],
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        },
      +        "refusals": {
      +          "items": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "count": {
      +                "maximum": 9007199254740991,
      +                "minimum": 0,
      +                "type": "integer"
      +              },
      +              "refusal": {
      +                "enum": [
      +                  "not_ledger_class",
      +                  "is_borrow",
      +                  "not_authorized",
      +                  "source_not_marked",
      +                  "holder_unknown",
      +                  "target_not_company",
      +                  "third_target_present",
      +                  "already_moving",
      +                  "connector_deleted",
      +                  "target_deleted",
      +                  "validated_books_present",
      +                  "issued_invoice_present",
      +                  "party_not_member",
      +                  "identity_claim_collision",
      +                  "held_row_without_grant",
      +                  "borrow_rows_in_target",
      +                  "chart_shared_with_unmoved_row",
      +                  "payslip_contract_stays",
      +                  "transaction_tag_stays",
      +                  "expense_payer_stays",
      +                  "shared_expense_stays"
      +                ],
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "refusal",
      +              "count"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "requested": {
      +          "anyOf": [
      +            {
      +              "type": "boolean"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        },
      +        "state": {
      +          "enum": [
      +            "not_requested",
      +            "pending",
      +            "armed",
      +            "nothing_to_move",
      +            "refused"
      +          ],
      +          "type": "string"
      +        },
      +        "units": {
      +          "maximum": 9007199254740991,
      +          "minimum": 0,
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "requested",
      +        "state",
      +        "armed",
      +        "units",
      +        "refusals",
      +        "refusal",
      +        "country_mismatch"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "The stored connector-move intent and its derived state; only armed means connections are moving."
      +}
    • addedOutput schema / properties / history
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "adoption_status": {
      +          "anyOf": [
      +            {
      +              "enum": [
      +                "pending",
      +                "in_progress",
      +                "partial",
      +                "stale",
      +                "complete",
      +                "failed"
      +              ],
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        },
      +        "brought": {
      +          "anyOf": [
      +            {
      +              "type": "boolean"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        },
      +        "counts": {
      +          "anyOf": [
      +            {
      +              "additionalProperties": false,
      +              "properties": {
      +                "accounts": {
      +                  "additionalProperties": false,
      +                  "properties": {
      +                    "capped": {
      +                      "type": "boolean"
      +                    },
      +                    "count": {
      +                      "type": "number"
      +                    }
      +                  },
      +                  "required": [
      +                    "count",
      +                    "capped"
      +                  ],
      +                  "type": "object"
      +                },
      +                "documents": {
      +                  "additionalProperties": false,
      +                  "properties": {
      +                    "capped": {
      +                      "type": "boolean"
      +                    },
      +                    "count": {
      +                      "type": "number"
      +                    }
      +                  },
      +                  "required": [
      +                    "count",
      +                    "capped"
      +                  ],
      +                  "type": "object"
      +                },
      +                "tasks": {
      +                  "additionalProperties": false,
      +                  "properties": {
      +                    "capped": {
      +                      "type": "boolean"
      +                    },
      +                    "count": {
      +                      "type": "number"
      +                    }
      +                  },
      +                  "required": [
      +                    "count",
      +                    "capped"
      +                  ],
      +                  "type": "object"
      +                },
      +                "transactions": {
      +                  "additionalProperties": false,
      +                  "properties": {
      +                    "capped": {
      +                      "type": "boolean"
      +                    },
      +                    "count": {
      +                      "type": "number"
      +                    }
      +                  },
      +                  "required": [
      +                    "count",
      +                    "capped"
      +                  ],
      +                  "type": "object"
      +                }
      +              },
      +              "required": [
      +                "documents",
      +                "tasks",
      +                "transactions",
      +                "accounts"
      +              ],
      +              "type": "object"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        }
      +      },
      +      "required": [
      +        "brought",
      +        "adoption_status",
      +        "counts"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "The stored history choice and the pre-mint counts of items that will be linked."
      +}
  2. Changed3 schema fields changed
    • addedInput schema / properties / bring_company_data
      Added value: +{
      +  "description": "The person's answer to: bring the company's history into its workspace (documents, tasks, transactions and accounts)? true brings it, false leaves it. Omit only when the person was not asked; omitting means true.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / existing_workspace_id
      Added value: +{
      +  "description": "The existing workspace's id when well_get_own_company returned one on this candidate: the person already has a workspace for that company, and passing the id attaches it under this one instead of minting a duplicate. Never pass an id the read did not return; leave it out for any candidate that carries none.",
      +  "format": "uuid",
      +  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      +  "type": "string"
      +}
    • addedInput schema / properties / move_connectors
      Added value: +{
      +  "description": "The person's answer to: move your bank and accounting connections into the company workspace? true moves them, false keeps them where they are. Ask first. Omitting records false: nothing moves unless the person opted in.",
      +  "type": "boolean"
      +}
  3. Changed1 schema field changed
    • changedOutput schema / properties / newly_connected / description
      Previous value: -"Tools that connected to this workspace since the last result and that no session was told about yet, oldest first. Present only when at least one tool is new. Start the reply with one line per entry, in the person's language: \"<name> is connected.\". Never fold several entries into one sentence. Each entry comes back once, on one result only: never repeat its line later."New value: +"Tools that connected to this workspace since the last result and that no session was told about yet, oldest first. Present only when at least one tool is new. The connected-line rule says when to tell an entry; when it does, one line per entry, in the person's language: \"<name> is connected.\". Never fold several entries into one sentence. Each entry comes back once, on one result only: never repeat its line later."
  4. Changed1 schema field changed
    • addedInput schema / properties / workspace_scope
      Added value: +{
      +  "description": "Restrict this call to the family: the token's primary workspace plus the company workspaces under it that you are a member of. Unrelated authorized workspaces drop out of the read; row reads merge across the family, while a per-workspace figure still reports exactly one workspace.",
      +  "enum": [
      +    "family"
      +  ],
      +  "type": "string"
      +}
  5. Changed1 schema field changed
    • addedOutput schema / properties / newly_connected
      Added value: +{
      +  "description": "Tools that connected to this workspace since the last result and that no session was told about yet, oldest first. Present only when at least one tool is new. Start the reply with one line per entry, in the person's language: \"<name> is connected.\". Never fold several entries into one sentence. Each entry comes back once, on one result only: never repeat its line later.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "name": {
      +        "type": "string"
      +      },
      +      "service_id": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "name",
      +      "service_id"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  6. Changed4 schema fields changed
    • addedInput schema / properties / conversation_id
      Added value: +{
      +  "description": "The conversation id returned by the previous Well result, in its meta under well/conversation_id, in its structuredContent, or in its JSON text block. Pass it back on every call in the same conversation, including a call a card makes, so the chosen workspace and the earlier answers still apply. It decides the conversation on its own: nothing the host states about the session replaces it. Omit it only on the first call of a conversation.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / conversation_id
      Added value: +{
      +  "description": "The conversation this result belongs to. Pass it back as the conversation_id argument on every later Well call in the same conversation.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / conversation_id_note
      Added value: +{
      +  "description": "Present only when the server opened a fresh lane, stating that no choice recorded earlier was read.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / conversation_id_source
      Added value: +{
      +  "description": "Where the conversation id came from: the host's own request meta, the caller's argument, or a fresh lane the server opened.",
      +  "enum": [
      +    "host_meta",
      +    "argument",
      +    "minted"
      +  ],
      +  "type": "string"
      +}
  7. Added

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources