Skip to main content
Glama
soil-dev

capsulemcp

by soil-dev

create_opportunity

Create a sales opportunity for an existing party and place it at a specific pipeline stage, with optional value, owner, team, close date, duration, and custom fields.

Instructions

Create a new opportunity linked to a party. Requires partyId and milestoneId (which pins the deal to a specific pipeline stage — pipeline is inferred from the milestone). Value is optional but if amount is set, currency must be set too (3-letter ISO 4217 code, e.g. 'USD'). Discover valid milestone ids via list_pipelines + list_milestones first. For multi-party deals, use add_additional_party after creation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
valueNo
fieldsNoSet custom field values on this record. PARTIAL UPDATE: only the definitions you list are touched; any field NOT in this array is left unchanged. Discover available definitions via list_custom_fields; read current values via get_opportunity with embed='fields'. Capsule's POST /opportunities accepts the same `fields[]` shape as PUT (inferred by symmetry with the v1.6.5 wire-trace findings on party and project creation — the tenant probed had no opportunity custom fields configured, so this is unverified empirically). Setting custom fields on creation removes the create-then-update ritual.
teamIdNoAssign to team ID (discover via list_teams). Independent from `ownerId` — setting one does NOT clear the other on create. Three ownership shapes are valid: owner alone, team alone, or owner+team (the owner must be a member of the team; users can belong to multiple teams — 422 'owner is not a member of the team' otherwise).
ownerIdNoAssign to user ID. Defaults to the API-token owner when omitted — note that opportunities do NOT inherit owner from the linked party, even though one might expect it. To clear owner later, call update_opportunity with `ownerId: null`. Discover IDs via list_users. WARNING: tenant pipeline / milestone-reached automation can mutate this field post-create — see the `milestoneId` description for details and the chained-PUT workaround.
partyIdYesID of the party this opportunity belongs to
durationNoHow many durationBasis units the contract runs (e.g. 12 with MONTH). Must be null/omitted when durationBasis is FIXED. Wire-verified: POST stores it, PUT changes it, and PUT duration:null with durationBasis:FIXED clears it.
descriptionNo
milestoneIdYesID of the pipeline milestone to place this opportunity at. The milestone implicitly determines the pipeline — there is no separate pipelineId parameter. Discover via list_pipelines / list_milestones. NOTE: some Capsule tenants configure **pipeline / milestone-reached automation rules** that mutate `owner` and/or `team` immediately after creation — e.g. an 'Assign to a Team' action that fires on entry to a specific milestone and has been observed to clear `owner` as an automation side-effect. If you observe a newly-created opp landing with `owner: null` despite passing `ownerId`, the cause is almost certainly a milestone automation on the destination pipeline rather than the connector. Documented workaround: follow `create_opportunity` with an immediate `batch_update_opportunity({items: [{id, ownerId, teamId}]})` carrying both fields — PUT does not re-fire milestone-reached triggers, so the owner sticks.
probabilityNo
durationBasisNoTime unit of the opportunity's contract duration. FIXED means a one-off (no recurring duration) — `duration` must be omitted/null with FIXED (Capsule 422s otherwise; wire-verified). Recurring deals: pair with `duration`, e.g. durationBasis MONTH + duration 12.
expectedCloseOnNoYYYY-MM-DD
trackDefinitionIdsNoTrack definition ids to apply at creation time (creation-only shortcut; use apply_track for existing records). Discover ids via list_track_definitions. Capsule validates each definition's entity scope and returns 422 on mismatch (e.g. "track definition must be for parties"). Wire-verified: the created record carries the track instances immediately.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv2.3.0
    • removedInput schema / properties / fields / items / properties / value / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / fields / items / properties / value / type
      Added value: +[
      +  "string",
      +  "number",
      +  "boolean",
      +  "null"
      +]
    • changedInput schema / properties / fields / items / required
      Previous value: -[
      -  "value"
      -]New value: +[
      +  "definitionId",
      +  "value"
      +]
    • changedInput schema / required
      Previous value: -[
      -  "name"
      -]New value: +[
      +  "name",
      +  "partyId",
      +  "milestoneId"
      +]
  2. Changed3 schema fields changedv2.2.0
    • addedInput schema / properties / duration
      Added value: +{
      +  "anyOf": [
      +    {
      +      "exclusiveMinimum": 0,
      +      "maximum": 9007199254740991,
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "How many durationBasis units the contract runs (e.g. 12 with MONTH). Must be null/omitted when durationBasis is FIXED. Wire-verified: POST stores it, PUT changes it, and PUT duration:null with durationBasis:FIXED clears it."
      +}
    • addedInput schema / properties / durationBasis
      Added value: +{
      +  "description": "Time unit of the opportunity's contract duration. FIXED means a one-off (no recurring duration) — `duration` must be omitted/null with FIXED (Capsule 422s otherwise; wire-verified). Recurring deals: pair with `duration`, e.g. durationBasis MONTH + duration 12.",
      +  "enum": [
      +    "FIXED",
      +    "HOUR",
      +    "DAY",
      +    "WEEK",
      +    "MONTH",
      +    "QUARTER",
      +    "YEAR"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / trackDefinitionIds
      Added value: +{
      +  "description": "Track definition ids to apply at creation time (creation-only shortcut; use apply_track for existing records). Discover ids via list_track_definitions. Capsule validates each definition's entity scope and returns 422 on mismatch (e.g. \"track definition must be for parties\"). Wire-verified: the created record carries the track instances immediately.",
      +  "items": {
      +    "exclusiveMinimum": 0,
      +    "maximum": 9007199254740991,
      +    "type": "integer"
      +  },
      +  "type": "array"
      +}
  3. Changed1 schema field changedv2.1.2
    • changedInput schema / properties / fields / description
      Previous value: -"Set custom field values on this record. PARTIAL UPDATE: only the definitions you list are touched; any field NOT in this array is left unchanged. Discover available definitions via list_custom_fields; read current values via get_opportunity with embed='fields'. Capsule's POST /opportunities accepts the same `fields[]` shape as PUT (inferred by symmetry with the v1.6.5 wire-trace findings on POST /parties and POST /kases — the tenant probed had no opportunity custom fields configured, so this is unverified empirically). Setting custom fields on creation removes the create-then-update ritual."New value: +"Set custom field values on this record. PARTIAL UPDATE: only the definitions you list are touched; any field NOT in this array is left unchanged. Discover available definitions via list_custom_fields; read current values via get_opportunity with embed='fields'. Capsule's POST /opportunities accepts the same `fields[]` shape as PUT (inferred by symmetry with the v1.6.5 wire-trace findings on party and project creation — the tenant probed had no opportunity custom fields configured, so this is unverified empirically). Setting custom fields on creation removes the create-then-update ritual."
  4. Addedv1.7.0
  5. Removedv1.6.2
  6. First observedv1.0.0

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare this is a non-read-only, non-destructive write, and the description does not contradict that. It adds one behavioral nuance (pipeline inferred from milestone) and the value/currency coupling, but does not mention creation side-effects such as milestone automation mutating owner/team or the default-owner behavior (those live only in the schema, not the tool description).

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

Conciseness5/5

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

Three sentences with the main action first, followed by the key constraint and the workflow pointers. No filler or repetition of the full schema; every sentence earns its place.

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 a 13-parameter creation tool with no output schema, the definition plus detailed schema gives enough to call it correctly: required fields, cross-parameter validation, discovery steps, and a follow-up sibling for multi-party deals. The only real gap is that the description doesn't state what the successful create returns, which would be useful when there is no output schema.

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 coverage is moderate (~69%), and the description mostly restates what the schema already documents — partyId and milestoneId are required, milestone determines pipeline, currency must accompany amount. It does add the concise discovery workflow and multi-party follow-up, but does not compensate for undocumented parameters like name, description, or probability.

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 'Create a new opportunity linked to a party' — a specific verb and resource that clearly distinguishes create_opportunity from update, search, get, and delete siblings. It also states the key linkage requirements (partyId, milestoneId), so an agent can tell what this tool is for before looking at the schema.

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 tells the agent to discover valid milestone ids via list_pipelines/list_milestones first and to use add_additional_party for multi-party deals, giving concrete pre- and post-steps. It does not explicitly state when not to use it or contrast it with update_opportunity, but the creation intent is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools