Skip to main content
Glama
soil-dev

capsulemcp

by soil-dev

update_opportunity

Update an existing opportunity in Capsule CRM: modify fields, reassign owner/team/party, change milestone or probability, and set custom values. Only provided fields are changed.

Instructions

Update fields on an existing opportunity, including the parent-reference field partyId to reassign the opp to a different primary party. ownerId and teamId both accept null to unassign (verified empirically in v1.6.5 wire-trace — brings update_opportunity into parity with update_party and update_project). The combination {ownerId: null, teamId: <id>} puts an opportunity into 'team-owned, no specific user' state, matching the pattern available on parties and projects. Only the fields you provide are changed. Closed (Won/Lost) opportunities ARE editable — Capsule does not enforce closed-record immutability, so value, description, etc. can be changed on a Won opp without warning. If the workflow needs historical revenue numbers to be stable, enforce that caller-side. Capsule requires every opportunity to have a party — passing partyId: null is rejected with 422 'party is required' (Unlike update_task.partyId which IS nullable — tasks can be orphaned in Capsule's model).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNo
nameNo
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'.
teamIdNoReassign team: pass a team ID (discover via list_teams) to set, or `null` to unassign. Capsule preserves the existing owner across a team change (server-side), so `update_opportunity { teamId }` alone is safe — the owner is carried through. Owner must be a member of the new team or Capsule returns 422 'owner is not a member of the team'. Independent from `ownerId` — setting `teamId` does NOT clear the owner.
ownerIdNoReassign owner: pass a user ID to set, or `null` to unassign (verified empirically in v1.6.5 wire-trace — Capsule accepts `owner: null` on PUT /opportunities/:id, mirroring the v1.6.4 finding on /parties; brings update_opportunity into parity with update_party and update_project). When you supply `ownerId` and omit `teamId`, the connector fetches the opportunity's current team and includes it in the PUT body to preserve it across the owner change. Without this defensive read, Capsule's PUT would clear the existing team (see NOTES-ON-CAPSULE-API.md §27 — same asymmetric semantic as project updates). Supply `teamId` explicitly on the same call to change the team instead. Combine `ownerId: null` + `teamId: <T>` in one call to transfer an opportunity to team-ownership with no specific user (verified empirically in v1.6.5; the owner-clears-team semantic doesn't fire when owner is being cleared to null).
partyIdNoReassign the opportunity to a different primary party. Capsule requires every opportunity to have a party — passing `null` is rejected with 422 'party is required' (use Capsule's web UI if you need to dissolve the link entirely). Discover ids via search_parties / filter_parties. No defensive read-modify-write needed: this connector verified empirically (v1.6.3 wire-trace) that `party` is a standalone PUT field on /opportunities and does not interact with the asymmetric owner/team semantic from NOTES-ON-CAPSULE-API.md §27. NOTE: parent-ref nullability differs by entity — `update_task.partyId` IS nullable (orphan task), but opportunities and projects must always have a parent party. The same applies to `update_project.partyId`.
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
milestoneIdNoMove the opportunity to this milestone. Side effects depend on the target: closing milestones (Won/Lost) auto-set `closedOn` to today and `probability` to the milestone default (100/0), preserving `lastOpenMilestone` as the previous open stage; moving back to an open milestone clears `closedOn` and re-applies the milestone's default probability (Won/Lost is reversible — no separate reopen tool). WARNING: Capsule does NOT validate that the new milestone belongs to the opportunity's current pipeline. Passing a milestoneId from a different pipeline silently relocates the opportunity across pipelines, and `lastOpenMilestone` may then reference a milestone in the previous pipeline. Verify against the opportunity's current pipeline (read the opp first, list its pipeline's milestones via list_milestones) before passing a cross-pipeline id. NOTE: changing `milestoneId` can fire **pipeline / milestone-reached automations** that mutate `owner` / `team` on the destination milestone (same shape as `create_opportunity` — see its `milestoneId` description for the owner-clearing automation caveat). If a milestone-change-and-owner-set in the same call lands with `owner: null`, follow up with a second `update_opportunity` (or `batch_update_opportunity`) carrying both `ownerId` and `teamId` — milestone-reached triggers only fire on the transition, so a subsequent PUT preserves your values.
probabilityNoWin probability 0–100. On an open milestone this overrides the milestone's default probability. CANNOT be set in the same call as a closing milestone (Won/Lost) — Capsule processes the milestone change first, the opportunity becomes closed, then the probability update is rejected as edit-on-closed-opp with 422 'probability can be updated only for open opportunity'. To close an opportunity, leave probability out of the call: it auto-snaps to 100% (Won) or 0% (Lost).
lostReasonIdNoReason the opportunity was lost. Only meaningful when transitioning to a Lost milestone — Capsule silently drops it for other milestones. Without this set, a connector-driven Lost-close leaves `lostReason: null`. Discover IDs via list_lost_reasons.
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.
expectedCloseOnNo
Install Server

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only set readOnlyHint=false and destructiveHint=false, which are self-evident for an update tool. The description carries the full behavioral burden and exceeds it: closed-record editability, null semantics for owner/team, the defensive read-modify-write for owner changes, milestone automations that can mutate owner/team, and empirical wire-trace verifications. No annotation contradiction; the description enriches the sparse annotation context substantially.

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 but every sentence carries operational information — no filler. It front-loads the core update capability, then systematically addresses edge cases. While it could be considered verbose, the density of the 14-parameter surface justifies the length. Minor deduction for a slight ramble in the fields.value sub-description, but overall well-structured.

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 14-parameter tool with no output schema and nested objects, the description is exhaustively complete. It covers nullability, side effects, cross-entity differences, automations, API quirks, and empirical verification references. An agent would have everything needed to call this correctly in any scenario.

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 64%, and the description compensates richly for parameters with complex semantics. For example, partyId explains null rejection and cross-entity nullability differences; ownerId details preservation logic and team-clear risk; milestoneId covers cross-pipeline relocation and automation side effects; probability clarifies the restriction when closing. Each parameter's description goes far beyond the schema's type and constraints.

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 'Update fields on an existing opportunity' and immediately names the primary fields (partyId, ownerId, teamId) and the reassignment semantics. It differentiates from siblings by noting parity with update_party/update_project and explicitly contrasting update_task.partyId nullability. The verb-resource-object relationship is precise and unambiguous.

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?

Provides explicit when-to-use guidance: reassign party via partyId, unassign owner/team with null, closed opportunities are editable (with a caveat to enforce stability caller-side). It also states when NOT to use — partyId: null is rejected and probability cannot be set alongside a closing milestone. The description names alternatives (e.g., use web UI for dissolving party link) and dependencies (e.g., read current value via embed='fields').

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

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/soil-dev/capsulemcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server