{
  "name": "Trapeza",
  "description": "Freelance business management — contacts, invoices, time tracking, estimates, expenses, appointments",
  "version": "1.0.0",
  "authentication": {
    "type": "bearer",
    "loginUrl": "/login",
    "tokenEndpoint": "/api/auth/login"
  },
  "tools": [
    {
      "name": "list_contacts",
      "description": "List all contacts (clients, suppliers, or both) with optional search and status filters. Returns contact names, types, emails, and phone numbers.",
      "endpoint": {
        "method": "GET",
        "path": "/api/contacts"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "search": {
            "type": "string",
            "description": "Search term to filter contacts by name, email, or organization"
          },
          "type": {
            "type": "string",
            "description": "Filter by contact type: customer, supplier, or both"
          },
          "status": {
            "type": "string",
            "description": "Filter by contact status: Active or Hidden"
          }
        },
        "required": []
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "get_contact",
      "description": "Get full details for a specific contact including name, type, email, CPF/CNPJ, phone, WhatsApp, and organization.",
      "endpoint": {
        "method": "GET",
        "path": "/api/contacts/{contactId}"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "contactId": {
            "type": "string",
            "description": "The unique identifier of the contact to retrieve"
          }
        },
        "required": [
          "contactId"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "create_contact",
      "description": "Create a new contact (client, supplier, or both) with their name, email, CPF/CNPJ, phone, and WhatsApp information.",
      "endpoint": {
        "method": "POST",
        "path": "/api/contacts"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Full name of the contact"
          },
          "contactType": {
            "type": "string",
            "description": "Contact type: customer, supplier, or both"
          },
          "email": {
            "type": "string",
            "description": "Email address of the contact"
          },
          "cpfCnpj": {
            "type": "string",
            "description": "Brazilian CPF (individual) or CNPJ (company) tax ID"
          },
          "phone": {
            "type": "string",
            "description": "Phone number of the contact"
          },
          "whatsapp": {
            "type": "string",
            "description": "WhatsApp number of the contact"
          },
          "organizationName": {
            "type": "string",
            "description": "Name of the organization the contact belongs to"
          }
        },
        "required": [
          "name",
          "contactType"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "update_contact",
      "description": "Update an existing contact's details such as name, email, type, CPF/CNPJ, phone, WhatsApp, or organization name.",
      "endpoint": {
        "method": "PUT",
        "path": "/api/contacts/{contactId}"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "contactId": {
            "type": "string",
            "description": "The unique identifier of the contact to update"
          },
          "name": {
            "type": "string",
            "description": "Updated full name of the contact"
          },
          "email": {
            "type": "string",
            "description": "Updated email address"
          },
          "contactType": {
            "type": "string",
            "description": "Updated contact type: customer, supplier, or both"
          },
          "cpfCnpj": {
            "type": "string",
            "description": "Updated CPF or CNPJ tax ID"
          },
          "phone": {
            "type": "string",
            "description": "Updated phone number"
          },
          "whatsapp": {
            "type": "string",
            "description": "Updated WhatsApp number"
          },
          "organizationName": {
            "type": "string",
            "description": "Updated organization name"
          }
        },
        "required": [
          "contactId"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "delete_contact",
      "description": "Permanently delete a contact. This action cannot be undone and will remove all associated data.",
      "endpoint": {
        "method": "DELETE",
        "path": "/api/contacts/{contactId}"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "contactId": {
            "type": "string",
            "description": "The unique identifier of the contact to delete"
          }
        },
        "required": [
          "contactId"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "confirmationRequired": true
      }
    },
    {
      "name": "list_invoices",
      "description": "List all invoices with optional filters by status (Draft, Sent, Overdue, Paid) and contact. Returns invoice numbers, amounts, due dates, and statuses.",
      "endpoint": {
        "method": "GET",
        "path": "/api/invoices"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Filter by invoice status: Draft, Sent, Overdue, or Paid"
          },
          "contactId": {
            "type": "string",
            "description": "Filter invoices by contact ID"
          }
        },
        "required": []
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "get_invoice",
      "description": "Get full details of a specific invoice including line items, taxes, totals, payment status, and associated contact.",
      "endpoint": {
        "method": "GET",
        "path": "/api/invoices/{invoiceId}"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "string",
            "description": "The unique identifier of the invoice to retrieve"
          }
        },
        "required": [
          "invoiceId"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "create_invoice",
      "description": "Create a new draft invoice for a contact with line items, due date, and optional notes. Each line item includes description, quantity, unit price, and tax rate.",
      "endpoint": {
        "method": "POST",
        "path": "/api/invoices"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "contactId": {
            "type": "string",
            "description": "The contact (client) to invoice"
          },
          "dueDate": {
            "type": "string",
            "description": "Invoice due date in YYYY-MM-DD format"
          },
          "lineItems": {
            "type": "array",
            "description": "List of invoice line items",
            "items": {
              "type": "object",
              "properties": {
                "description": {
                  "type": "string",
                  "description": "Description of the line item"
                },
                "quantity": {
                  "type": "number",
                  "description": "Quantity of items"
                },
                "unitPriceCents": {
                  "type": "number",
                  "description": "Unit price in cents (e.g., 10000 = R$100.00)"
                },
                "taxRate": {
                  "type": "number",
                  "description": "Tax rate as a decimal (e.g., 0.05 for 5%)"
                }
              },
              "required": [
                "description",
                "quantity",
                "unitPriceCents"
              ]
            }
          },
          "notes": {
            "type": "string",
            "description": "Optional notes to include on the invoice"
          }
        },
        "required": [
          "contactId",
          "dueDate",
          "lineItems"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "update_invoice",
      "description": "Update an existing draft invoice's due date, line items, or notes. Only draft invoices can be modified.",
      "endpoint": {
        "method": "PUT",
        "path": "/api/invoices/{invoiceId}"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "string",
            "description": "The unique identifier of the invoice to update"
          },
          "dueDate": {
            "type": "string",
            "description": "Updated due date in YYYY-MM-DD format"
          },
          "lineItems": {
            "type": "array",
            "description": "Updated list of invoice line items",
            "items": {
              "type": "object",
              "properties": {
                "description": {
                  "type": "string",
                  "description": "Description of the line item"
                },
                "quantity": {
                  "type": "number",
                  "description": "Quantity of items"
                },
                "unitPriceCents": {
                  "type": "number",
                  "description": "Unit price in cents"
                },
                "taxRate": {
                  "type": "number",
                  "description": "Tax rate as a decimal"
                }
              },
              "required": [
                "description",
                "quantity",
                "unitPriceCents"
              ]
            }
          },
          "notes": {
            "type": "string",
            "description": "Updated notes"
          }
        },
        "required": [
          "invoiceId"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "send_invoice",
      "description": "Send an invoice to the client via email. Changes the invoice status from Draft to Sent. The client will receive the invoice at their registered email.",
      "endpoint": {
        "method": "POST",
        "path": "/api/invoices/{invoiceId}/send"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "string",
            "description": "The unique identifier of the invoice to send"
          }
        },
        "required": [
          "invoiceId"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "confirmationRequired": true
      }
    },
    {
      "name": "record_payment",
      "description": "Record a payment for an invoice, marking it as paid. Requires the payment method (PIX, bank transfer, cash, etc.) and payment date.",
      "endpoint": {
        "method": "POST",
        "path": "/api/invoices/{invoiceId}/payment"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "string",
            "description": "The unique identifier of the invoice to mark as paid"
          },
          "paymentMethod": {
            "type": "string",
            "description": "Payment method used (e.g., PIX, BankTransfer, Cash, CreditCard)"
          },
          "paymentDate": {
            "type": "string",
            "description": "Date the payment was received in YYYY-MM-DD format"
          }
        },
        "required": [
          "invoiceId",
          "paymentMethod",
          "paymentDate"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "confirmationRequired": true
      }
    },
    {
      "name": "duplicate_invoice",
      "description": "Create a copy of an existing invoice as a new draft. Useful for recurring billing to the same client with the same line items.",
      "endpoint": {
        "method": "POST",
        "path": "/api/invoices/{invoiceId}/duplicate"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "string",
            "description": "The unique identifier of the invoice to duplicate"
          }
        },
        "required": [
          "invoiceId"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "emit_nfse",
      "description": "Emit a Nota Fiscal de Servico Eletronica (NFS-e) for an invoice via the Focus NFe integration. This is a legally binding fiscal document and cannot be reversed.",
      "endpoint": {
        "method": "POST",
        "path": "/api/invoices/{invoiceId}/emit-nfse"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "string",
            "description": "The unique identifier of the invoice to emit NFS-e for"
          }
        },
        "required": [
          "invoiceId"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "confirmationRequired": true
      }
    },
    {
      "name": "list_time_entries",
      "description": "List time entries with optional filters by project and date range. Returns logged hours, descriptions, and associated projects.",
      "endpoint": {
        "method": "GET",
        "path": "/api/time-entries"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string",
            "description": "Filter time entries by project ID"
          },
          "startDate": {
            "type": "string",
            "description": "Start of date range in YYYY-MM-DD format"
          },
          "endDate": {
            "type": "string",
            "description": "End of date range in YYYY-MM-DD format"
          }
        },
        "required": []
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "log_time",
      "description": "Log a new time entry for a project. Specify the date, duration in minutes, and an optional description of the work performed.",
      "endpoint": {
        "method": "POST",
        "path": "/api/time-entries"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string",
            "description": "The project to log time against"
          },
          "date": {
            "type": "string",
            "description": "Date of the time entry in YYYY-MM-DD format"
          },
          "durationMinutes": {
            "type": "number",
            "description": "Duration of work in minutes (e.g., 90 for 1.5 hours)"
          },
          "description": {
            "type": "string",
            "description": "Description of the work performed"
          },
          "taskDescription": {
            "type": "string",
            "description": "Specific task or activity description"
          }
        },
        "required": [
          "projectId",
          "date",
          "durationMinutes"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "update_time_entry",
      "description": "Update an existing time entry's date, duration, description, or task description.",
      "endpoint": {
        "method": "PUT",
        "path": "/api/time-entries/{entryId}"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "entryId": {
            "type": "string",
            "description": "The unique identifier of the time entry to update"
          },
          "date": {
            "type": "string",
            "description": "Updated date in YYYY-MM-DD format"
          },
          "durationMinutes": {
            "type": "number",
            "description": "Updated duration in minutes"
          },
          "description": {
            "type": "string",
            "description": "Updated work description"
          },
          "taskDescription": {
            "type": "string",
            "description": "Updated task description"
          }
        },
        "required": [
          "entryId"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "delete_time_entry",
      "description": "Permanently delete a time entry. This cannot be undone and will affect project time totals.",
      "endpoint": {
        "method": "DELETE",
        "path": "/api/time-entries/{entryId}"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "entryId": {
            "type": "string",
            "description": "The unique identifier of the time entry to delete"
          }
        },
        "required": [
          "entryId"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "confirmationRequired": true
      }
    },
    {
      "name": "list_projects",
      "description": "List all projects with their names, associated contacts, billing types, and budget status.",
      "endpoint": {
        "method": "GET",
        "path": "/api/projects"
      },
      "inputSchema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "get_project",
      "description": "Get full details of a specific project including budget tracking, time entries summary, expenses, and billing configuration.",
      "endpoint": {
        "method": "GET",
        "path": "/api/projects/{projectId}"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string",
            "description": "The unique identifier of the project to retrieve"
          }
        },
        "required": [
          "projectId"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "create_project",
      "description": "Create a new project for a contact with a name, billing type (Hourly or FixedPrice), and optional rate or fixed price amount.",
      "endpoint": {
        "method": "POST",
        "path": "/api/projects"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "contactId": {
            "type": "string",
            "description": "The contact (client) this project belongs to"
          },
          "name": {
            "type": "string",
            "description": "Name of the project"
          },
          "billingType": {
            "type": "string",
            "description": "Billing model: Hourly or FixedPrice"
          },
          "hourlyRateCents": {
            "type": "number",
            "description": "Hourly rate in cents for Hourly projects (e.g., 15000 = R$150.00/h)"
          },
          "fixedPriceCents": {
            "type": "number",
            "description": "Total fixed price in cents for FixedPrice projects"
          },
          "currency": {
            "type": "string",
            "description": "Currency code (default: BRL)"
          }
        },
        "required": [
          "contactId",
          "name",
          "billingType"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "update_project",
      "description": "Update an existing project's name, billing type, hourly rate, fixed price, or currency.",
      "endpoint": {
        "method": "PUT",
        "path": "/api/projects/{projectId}"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string",
            "description": "The unique identifier of the project to update"
          },
          "name": {
            "type": "string",
            "description": "Updated project name"
          },
          "billingType": {
            "type": "string",
            "description": "Updated billing type: Hourly or FixedPrice"
          },
          "hourlyRateCents": {
            "type": "number",
            "description": "Updated hourly rate in cents"
          },
          "fixedPriceCents": {
            "type": "number",
            "description": "Updated fixed price in cents"
          },
          "currency": {
            "type": "string",
            "description": "Updated currency code"
          }
        },
        "required": [
          "projectId"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "list_estimates",
      "description": "List all estimates (proposals/quotes) with optional filters by status and contact. Returns estimate numbers, amounts, validity dates, and statuses.",
      "endpoint": {
        "method": "GET",
        "path": "/api/estimates"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Filter by estimate status (e.g., Draft, Sent, Accepted, Rejected)"
          },
          "contactId": {
            "type": "string",
            "description": "Filter estimates by contact ID"
          }
        },
        "required": []
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "get_estimate",
      "description": "Get full details of a specific estimate including line items, totals, validity date, and associated contact.",
      "endpoint": {
        "method": "GET",
        "path": "/api/estimates/{estimateId}"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "estimateId": {
            "type": "string",
            "description": "The unique identifier of the estimate to retrieve"
          }
        },
        "required": [
          "estimateId"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "create_estimate",
      "description": "Create a new estimate (proposal/quote) for a contact with line items and a validity date. Each line item includes description, quantity, and unit price.",
      "endpoint": {
        "method": "POST",
        "path": "/api/estimates"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "contactId": {
            "type": "string",
            "description": "The contact (client) to create the estimate for"
          },
          "validUntil": {
            "type": "string",
            "description": "Date until which the estimate is valid in YYYY-MM-DD format"
          },
          "lineItems": {
            "type": "array",
            "description": "List of estimate line items",
            "items": {
              "type": "object",
              "properties": {
                "description": {
                  "type": "string",
                  "description": "Description of the line item"
                },
                "quantity": {
                  "type": "number",
                  "description": "Quantity of items"
                },
                "unitPriceCents": {
                  "type": "number",
                  "description": "Unit price in cents (e.g., 10000 = R$100.00)"
                }
              },
              "required": [
                "description",
                "quantity",
                "unitPriceCents"
              ]
            }
          },
          "notes": {
            "type": "string",
            "description": "Optional notes to include on the estimate"
          }
        },
        "required": [
          "contactId",
          "validUntil",
          "lineItems"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "send_estimate",
      "description": "Send an estimate to the client via email. The client will receive the estimate at their registered email address.",
      "endpoint": {
        "method": "POST",
        "path": "/api/estimates/{estimateId}/send-email"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "estimateId": {
            "type": "string",
            "description": "The unique identifier of the estimate to send"
          }
        },
        "required": [
          "estimateId"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "confirmationRequired": true
      }
    },
    {
      "name": "convert_estimate_to_invoice",
      "description": "Convert an accepted estimate into a new draft invoice. The invoice will be pre-filled with the estimate's line items and contact.",
      "endpoint": {
        "method": "POST",
        "path": "/api/estimates/{estimateId}/convert-to-invoice"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "estimateId": {
            "type": "string",
            "description": "The unique identifier of the estimate to convert"
          }
        },
        "required": [
          "estimateId"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "confirmationRequired": true
      }
    },
    {
      "name": "list_expenses",
      "description": "List all expenses with optional filters by project and status. Returns expense descriptions, amounts, dates, categories, and reimbursable flags.",
      "endpoint": {
        "method": "GET",
        "path": "/api/expenses"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string",
            "description": "Filter expenses by project ID"
          },
          "status": {
            "type": "string",
            "description": "Filter by expense status"
          }
        },
        "required": []
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "create_expense",
      "description": "Record a new expense against a project with amount, date, category, and whether it is reimbursable to the client.",
      "endpoint": {
        "method": "POST",
        "path": "/api/expenses"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string",
            "description": "The project this expense belongs to"
          },
          "description": {
            "type": "string",
            "description": "Description of the expense"
          },
          "amountCents": {
            "type": "number",
            "description": "Expense amount in cents (e.g., 5000 = R$50.00)"
          },
          "date": {
            "type": "string",
            "description": "Date of the expense in YYYY-MM-DD format"
          },
          "category": {
            "type": "string",
            "description": "Expense category (e.g., Travel, Software, Materials)"
          },
          "reimbursable": {
            "type": "boolean",
            "description": "Whether this expense should be billed to the client"
          }
        },
        "required": [
          "projectId",
          "description",
          "amountCents",
          "date"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "update_expense",
      "description": "Update an existing expense's description, amount, date, category, or reimbursable flag.",
      "endpoint": {
        "method": "PUT",
        "path": "/api/expenses/{expenseId}"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "expenseId": {
            "type": "string",
            "description": "The unique identifier of the expense to update"
          },
          "description": {
            "type": "string",
            "description": "Updated expense description"
          },
          "amountCents": {
            "type": "number",
            "description": "Updated amount in cents"
          },
          "date": {
            "type": "string",
            "description": "Updated date in YYYY-MM-DD format"
          },
          "category": {
            "type": "string",
            "description": "Updated expense category"
          },
          "reimbursable": {
            "type": "boolean",
            "description": "Updated reimbursable flag"
          }
        },
        "required": [
          "expenseId"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "delete_expense",
      "description": "Permanently delete an expense record. This cannot be undone and will affect project expense totals.",
      "endpoint": {
        "method": "DELETE",
        "path": "/api/expenses/{expenseId}"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "expenseId": {
            "type": "string",
            "description": "The unique identifier of the expense to delete"
          }
        },
        "required": [
          "expenseId"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "confirmationRequired": true
      }
    },
    {
      "name": "list_appointments",
      "description": "List all service appointments with optional filters by status and date range. Returns scheduled dates, times, service descriptions, and statuses.",
      "endpoint": {
        "method": "GET",
        "path": "/api/appointments"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Filter by appointment status (e.g., Scheduled, Confirmed, Completed, Cancelled)"
          },
          "from": {
            "type": "string",
            "description": "Start of date range in YYYY-MM-DD format"
          },
          "to": {
            "type": "string",
            "description": "End of date range in YYYY-MM-DD format"
          }
        },
        "required": []
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "create_appointment",
      "description": "Schedule a new service appointment for a contact with date, time, estimated duration, and service description.",
      "endpoint": {
        "method": "POST",
        "path": "/api/appointments"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "contactId": {
            "type": "string",
            "description": "The contact (client) for this appointment"
          },
          "scheduledDate": {
            "type": "string",
            "description": "Date of the appointment in YYYY-MM-DD format"
          },
          "scheduledTime": {
            "type": "string",
            "description": "Time of the appointment in HH:mm format (e.g., 09:00)"
          },
          "estimatedDurationMinutes": {
            "type": "number",
            "description": "Estimated duration of the service in minutes"
          },
          "serviceDescription": {
            "type": "string",
            "description": "Description of the service to be performed"
          },
          "addressId": {
            "type": "string",
            "description": "Optional address ID for the service location"
          }
        },
        "required": [
          "contactId",
          "scheduledDate",
          "scheduledTime",
          "estimatedDurationMinutes",
          "serviceDescription"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "update_appointment_status",
      "description": "Change an appointment's status to Confirmed, Completed, or Cancelled. Cancelled appointments cannot be reopened.",
      "endpoint": {
        "method": "POST",
        "path": "/api/appointments/{appointmentId}/status"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "appointmentId": {
            "type": "string",
            "description": "The unique identifier of the appointment"
          },
          "status": {
            "type": "string",
            "description": "New status: Confirmed, Completed, or Cancelled"
          }
        },
        "required": [
          "appointmentId",
          "status"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "confirmationRequired": true
      }
    },
    {
      "name": "get_dashboard_metrics",
      "description": "Get dashboard metrics for a specific period including revenue, outstanding invoices, overdue amounts, and time tracked. Period format is YYYY-MM.",
      "endpoint": {
        "method": "GET",
        "path": "/api/dashboard/metrics"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "period": {
            "type": "string",
            "description": "Period to retrieve metrics for in YYYY-MM format (e.g., 2026-03)"
          }
        },
        "required": []
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "get_attention_items",
      "description": "Get items that need attention such as overdue invoices, upcoming deadlines, and pending appointments. Used for the dashboard activity feed.",
      "endpoint": {
        "method": "GET",
        "path": "/api/dashboard/attention"
      },
      "inputSchema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    },
    {
      "name": "get_fiscal_settings",
      "description": "Get the current fiscal settings including NFS-e configuration, tax rates, company data, and PIX/bank information.",
      "endpoint": {
        "method": "GET",
        "path": "/api/settings/fiscal"
      },
      "inputSchema": {
        "type": "object",
        "properties": {},
        "required": []
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "confirmationRequired": false
      }
    }
  ]
}