Compras Divididas MCP
Use this skill to operate the monthly reconciliation flow via the compras_divididas MCP server, without manual HTTP calls.
Operating flow
- •Validate connectivity by calling
list_participantsat the start of the session. - •Map the returned
participant_idvalues and reuse those exact IDs in all other tools. - •Select the right tool for the user's intent:
- •Register a recurrence:
create_recurrence - •Installment shorthand (for example
500 12xor500x12):create_recurrence - •List recurrence lifecycle/status:
list_recurrences - •Edit recurrence settings:
edit_recurrence - •End a recurrence logically:
end_recurrence - •Register a purchase or refund:
create_movement - •Find a purchase for a refund:
list_movements - •Check the month partials:
get_monthly_summary(always sendauto_generate=true) - •Get the on-demand consolidated report:
get_monthly_report(always sendauto_generate=true)
- •Register a recurrence:
- •Validate the result using canonical fields (
id,competence_month,total_net,transfer). - •Handle failures using the playbook in
references/api_reference.md. - •After each tool call, always answer with the PT-BR template from
references/response_templates.md, with no extra text outside the selected template.
Critical rules
- •Send
amountas a 2-decimal string ("120.50"), never as a float. - •For recurrence operations, always use a 50/50 split with
split_config={"mode":"equal"}. - •Send
external_idfor WhatsApp/integration events to enable safe deduplication. - •Do not guess
participant_id; discover it withlist_participantsbefore creating movements. - •Send
occurred_atwhen backfilling history; if omitted, the API uses the current timestamp inAmerica/Sao_Paulo. - •Create refunds only with an original purchase reference (
original_purchase_idororiginal_purchase_external_id). - •Keep post-tool messages direct, in Portuguese, and with emoji.
- •Template compliance is mandatory: select exactly one template variant for the executed tool (
success,error, orempty) and only replace placeholders. - •Do not add headings, explanations, JSON dumps, tool traces, or any extra lines before/after the template output.
Intent mapping for installment shorthand
- •Treat installment expressions as recurrence creation (
create_recurrence), not as one-off purchases (create_movement). - •Supported shorthand patterns:
- •
<description> <amount> <installments>x(example:Smartphone 500 12x) - •
<description> <amount>x<installments>(example:Smartphone 500x12)
- •
- •Parsing rules:
- •
description: text before the amount token. - •
amount: installment amount, normalized to a 2-decimal string ("500.00"). - •
installments: integer afterx; wheninstallments >= 2, create a fixed-duration recurrence.
- •
- •Recurrence payload construction for shorthand:
- •
start_competence_month: month provided by user; otherwise current competence month. - •
end_competence_month:start_competence_month + installments - 1months (inclusive). - •
reference_day: explicit day from user; otherwise current day inAmerica/Sao_Paulo. - •
split_config: always{"mode":"equal"}.
- •
- •Only use
create_movementfor these patterns when the user explicitly asks to register a single purchase.
Recommended sequences
Register a purchase
- •Call
list_participantsand map the sender torequested_by_participant_id. - •Call
create_movementwithtype="purchase",amount,description, andexternal_id(when available). - •Persist the returned
idto make future refunds easier.
Register a recurrence
- •Call
list_participantsand map valid participant IDs. - •Call
create_recurrencewithdescription,amount,payer_participant_id,requested_by_participant_id,split_config={"mode":"equal"},reference_day, andstart_competence_month. - •Optionally include
end_competence_monthfor fixed-duration recurrences. - •Confirm
status=activeand keep the returned recurrenceidfor future lifecycle operations.
Manage recurrence lifecycle
- •Call
list_recurrenceswith optional filters (status,year,month,limit,offset) to locate target rules. - •Call
edit_recurrenceto update fields (for exampleamount,description,reference_day) while keepingsplit_config={"mode":"equal"}. - •Use
clear_end_competence_month=trueinedit_recurrencewhen you need to remove an existing end month. - •Call
end_recurrenceto end a recurrence logically (status transition toended), optionally passingend_competence_month.
Register a refund without a purchase_id
- •Call
list_movementswithyear,month, and filters (type="purchase",amount,description,participant_id,external_id) to locate the purchase. - •Prefer
original_purchase_idwhen it is available. - •Use
original_purchase_external_idwhen thepurchase_idis not available and the external identifier is trustworthy.
Close the monthly reconciliation
- •Call
get_monthly_summarywithauto_generate=trueto validate the partials. - •Call
get_monthly_reportwithauto_generate=truefor the on-demand consolidated view (same response schema). - •Communicate
transfer.amount,transfer.debtor_participant_id, andtransfer.creditor_participant_id.
Auto-generate recurrent entries before consultation
- •Always call
get_monthly_summaryandget_monthly_reportwithauto_generate=true. - •Do not use
auto_generate=falsein this skill.
Detailed reference
Read references/api_reference.md for the full contract for each tool:
- •required and optional parameters
- •validations and limits
- •response format
- •common errors and corrective action
Read references/response_templates.md to format every post-tool answer:
- •one success template and one failure template per tool
- •direct PT-BR text with emojis
- •placeholders with deterministic filling rules
- •mandatory output contract for every tool response
Response formatting policy
- •Never answer raw JSON after using a tool.
- •Always convert the result to the corresponding PT-BR template.
- •Keep at most 3-6 lines when possible.
- •Include only actionable fields (IDs, values, competence month, transfer).
- •Respect the template line order and labels exactly as documented.
- •If a placeholder value is missing, apply the fallback rules in
references/response_templates.mdinstead of inventing new wording.