Caderninho / guias
Assistentes e ferramentasFerramentas MCPCartões, faturas e parcelas

get_card_commitments

Compromissos observados de contas CREDIT: gastos efetivos POSTED, pendentes e futuras importadas separados; parcelas por mês, categorias e limites explícitos. Créditos classificados como despesa reduzem o gasto. Não prevê parcelas ausentes, não soma pagamento de fatura e não confunde ocupação observada com limite bancário.

Cartões, faturas e parcelas · Consultar · Consulta / prévia

Efeito da chamada

Consulta ou simula sem gravar alterações financeiras nem iniciar uma importação.

Parâmetros

CampoObrigatórioTipoUso
accountIdNãotextoID de conta devolvido por get_accounts.
currencyNãotextoMoeda da operação. Valores de moedas diferentes permanecem separados.
monthNãotextoMês de referência no formato AAAA-MM.
monthsNãointeiroQuantidade de meses do horizonte ou plano, conforme esta ferramenta. Padrão: 12. Máximo: 12. Mínimo: 1.
personIdNãotextoTitular declarado. Obtenha seu ID em caderninho_status.
spaceIdNãotextoEspaço da instalação. Consulte get_spaces; o espaço inicial é personal. Padrão: "personal".

Filtros compostos e limites estão no schema completo. Campos não listados são recusados.

Exemplo de chamada

Substitua os IDs fictícios pelos da sua instalação, obtidos nas consultas indicadas nos parâmetros.


{
  "name": "get_card_commitments",
  "arguments": {}
}

Interpretar o resultado

Preserve moeda, valores desconhecidos, cobertura e datas de referência informados na resposta. Uma leitura sem registros não comprova ausência de movimentos no banco. Para totais, use agregações de toda a seleção.

O JSON Schema de saída está em Contrato completo.

Contrato completo

Ver JSON Schema de entrada

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "accountId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 160
    },
    "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$"
    },
    "month": {
      "type": "string",
      "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
    },
    "months": {
      "default": 12,
      "type": "integer",
      "minimum": 1,
      "maximum": 12
    },
    "personId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 160
    },
    "spaceId": {
      "default": "personal",
      "type": "string",
      "minLength": 1,
      "maxLength": 160
    }
  },
  "additionalProperties": false
}
Ver JSON Schema de saída

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "coverage": {
      "type": "object",
      "properties": {
        "connectionIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "kind": {
          "type": "string",
          "enum": [
            "imported",
            "local_only",
            "empty"
          ]
        },
        "oldestLastSuccessAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "partial": {
          "type": "boolean"
        }
      },
      "required": [
        "connectionIds",
        "kind",
        "oldestLastSuccessAt",
        "partial"
      ],
      "additionalProperties": false
    },
    "data": {
      "type": "object",
      "properties": {
        "accounts": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "allocatedCreditMinor": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "availabilitySource": {
                "type": "string",
                "enum": [
                  "provider",
                  "estimated",
                  "unavailable"
                ]
              },
              "availableCreditMinor": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "balanceObservedAt": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "creditLimitMinor": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "currency": {
                "type": "string"
              },
              "hidden": {
                "type": "boolean"
              },
              "id": {
                "type": "string"
              },
              "identity": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "cardBrand": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "institution": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "logoUrl": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "logoUrl",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "cardBrand",
                      "institution"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "limitSource": {
                "type": "string",
                "enum": [
                  "provider",
                  "manual",
                  "unavailable"
                ]
              },
              "manual": {
                "type": "boolean"
              },
              "name": {
                "type": "string"
              },
              "personId": {
                "type": "string"
              },
              "personName": {
                "type": "string"
              }
            },
            "required": [
              "allocatedCreditMinor",
              "availabilitySource",
              "availableCreditMinor",
              "balanceObservedAt",
              "creditLimitMinor",
              "currency",
              "hidden",
              "id",
              "limitSource",
              "manual",
              "name",
              "personId",
              "personName"
            ],
            "additionalProperties": false
          }
        },
        "assumptions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "categories": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "amountMinor": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "color": {
                "type": "string"
              },
              "currency": {
                "type": "string"
              },
              "id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "knownAmountMinor": {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              "name": {
                "type": "string"
              },
              "unknownAmountCount": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "amountMinor",
              "color",
              "currency",
              "id",
              "knownAmountMinor",
              "name",
              "unknownAmountCount"
            ],
            "additionalProperties": false
          }
        },
        "categoryBasis": {
          "type": "string",
          "const": "observed_commitments"
        },
        "from": {
          "type": "string",
          "format": "date",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
        },
        "installments": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "accountId": {
                "type": "string"
              },
              "accountName": {
                "type": "string"
              },
              "amountMinor": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "cardNumber": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "categoryId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "categoryName": {
                "type": "string"
              },
              "currency": {
                "type": "string"
              },
              "date": {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              "description": {
                "type": "string"
              },
              "direction": {
                "type": "string",
                "enum": [
                  "DEBIT",
                  "CREDIT"
                ]
              },
              "id": {
                "type": "string"
              },
              "installmentNumber": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "phase": {
                "type": "string",
                "enum": [
                  "spent",
                  "pending",
                  "future"
                ]
              },
              "purchaseDate": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "status": {
                "type": "string",
                "enum": [
                  "POSTED",
                  "PENDING"
                ]
              },
              "totalInstallments": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "accountId",
              "accountName",
              "amountMinor",
              "cardNumber",
              "categoryId",
              "categoryName",
              "currency",
              "date",
              "description",
              "direction",
              "id",
              "installmentNumber",
              "phase",
              "purchaseDate",
              "status",
              "totalInstallments"
            ],
            "additionalProperties": false
          }
        },
        "month": {
          "type": "string",
          "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
        },
        "months": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string"
              },
              "futureMinor": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "knownFutureMinor": {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              "knownObservedCommitmentsMinor": {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              "knownPendingMinor": {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              "knownSpentMinor": {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              "knownUnclassifiedMinor": {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              "observedCommitmentsMinor": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "pendingMinor": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "spentMinor": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "unclassifiedCount": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "unclassifiedUnknownAmountCount": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "unknownAmountCount": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "month": {
                "type": "string",
                "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
              }
            },
            "required": [
              "currency",
              "futureMinor",
              "knownFutureMinor",
              "knownObservedCommitmentsMinor",
              "knownPendingMinor",
              "knownSpentMinor",
              "knownUnclassifiedMinor",
              "observedCommitmentsMinor",
              "pendingMinor",
              "spentMinor",
              "unclassifiedCount",
              "unclassifiedUnknownAmountCount",
              "unknownAmountCount",
              "month"
            ],
            "additionalProperties": false
          }
        },
        "referenceDay": {
          "type": "string",
          "format": "date",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
        },
        "to": {
          "type": "string",
          "format": "date",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
        },
        "totals": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string"
              },
              "futureMinor": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "knownFutureMinor": {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              "knownObservedCommitmentsMinor": {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              "knownPendingMinor": {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              "knownSpentMinor": {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              "knownUnclassifiedMinor": {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              "observedCommitmentsMinor": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "pendingMinor": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "spentMinor": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "unclassifiedCount": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "unclassifiedUnknownAmountCount": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "unknownAmountCount": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "currency",
              "futureMinor",
              "knownFutureMinor",
              "knownObservedCommitmentsMinor",
              "knownPendingMinor",
              "knownSpentMinor",
              "knownUnclassifiedMinor",
              "observedCommitmentsMinor",
              "pendingMinor",
              "spentMinor",
              "unclassifiedCount",
              "unclassifiedUnknownAmountCount",
              "unknownAmountCount"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "accounts",
        "assumptions",
        "categories",
        "categoryBasis",
        "from",
        "installments",
        "month",
        "months",
        "referenceDay",
        "to",
        "totals"
      ],
      "additionalProperties": false
    },
    "oldestLastSuccessAt": {
      "type": [
        "string",
        "null"
      ]
    },
    "partial": {
      "type": "boolean"
    },
    "revision": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "scope": {
      "type": "object",
      "properties": {
        "personId": {
          "type": "string"
        },
        "spaceId": {
          "type": "string"
        }
      },
      "required": [
        "spaceId"
      ],
      "additionalProperties": false
    },
    "view": {
      "type": "string",
      "const": "effective"
    }
  },
  "required": [
    "coverage",
    "data",
    "oldestLastSuccessAt",
    "partial",
    "revision",
    "scope",
    "view"
  ],
  "additionalProperties": false
}

Voltar para Cartões, faturas e parcelas · Confirmações e contratos

Nesta página