Skip to main content
Glama

save_client

Save a client in the company's registry, or update a saved one.

It records a recipient for later issuances; it issues nothing. A document already saved is refused with the existing client's id — call get_client or pass that id here to update it instead. Confirm the data with the user when any of it was inferred.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>"
    },
    "name": "save_client"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesLegal name (razao social) or full name.
emailNoContact email, e.g. financeiro@empresa.com.
notesNoFree text kept with the client.
phoneNoContact phone with area code, e.g. 11987654321.
tax_idNoCPF or CNPJ. Required, except for a buyer abroad (address.state EX).
addressNoPostal address: street, number, neighborhood, city, state (UF), zip_code and city_code (IBGE). An NF-e to this client needs all of them.
client_idNoUpdate this saved client instead of creating one. Only the fields sent change.
company_idNoUUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both.
foreign_idNoPassport or other document of a buyer abroad, used instead of tax_id.
company_tax_idNoCNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both.
state_registrationNoState registration (IE), digits or ISENTO. Leave it out for a non-contributor.
municipal_registrationNoInscricao municipal.

Output Schema

NameRequiredDescriptionDefault
idNoPass it as client_id to issue_invoice or save_client.
nameNo
sourceNomanual, issued (imported from issued invoices) or issuance (saved by an issuance).
tax_idNoCPF (11 digits) or CNPJ (14 characters, unpunctuated). A CNPJ may carry letters in its first 12 positions since July 2026, so never treat it as a number.
addressNo
is_activeNo
foreign_idNoDocument of a buyer abroad.
uses_countNo
last_used_atNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / municipal_registration
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maxLength": 15,
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Inscricao municipal."
      +}
  2. Changed4 schema fields changed
    • addedInput schema / properties / address / properties / complement
      Added value: +{
      +  "default": null,
      +  "description": "Apartment, suite or block.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedInput schema / properties / address / properties / country_iso2
      Added value: +{
      +  "default": null,
      +  "description": "ISO alpha-2 of a buyer abroad, nfse only.",
      +  "pattern": "^[A-Z]{2}$",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedInput schema / properties / address / properties / postal_code
      Added value: +{
      +  "default": null,
      +  "description": "Postal code abroad, NFS-e only.",
      +  "maxLength": 11,
      +  "minLength": 1,
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedInput schema / properties / address / properties / province
      Added value: +{
      +  "default": null,
      +  "description": "State, province or region abroad, NFS-e only.",
      +  "maxLength": 60,
      +  "minLength": 1,
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
  3. Changed4 schema fields changed
    • changedInput schema / properties / address / properties / country_code / description
      Previous value: -"BACEN country code, 1 to 4 digits. Required, and not 1058, when state is EX. Its check digit is not verified: the official table has countries whose digit does not close."New value: +"BACEN code, 1 to 4 digits. Required, not 1058, when state is EX."
    • changedInput schema / properties / address / properties / state_registration / description
      Previous value: -"Recipient's IE (inscrição estadual), NF-e only. Send it for a recipient registered as an ICMS contributor; ISENTO for an exempt one; leave it out for a non-contributor."New value: +"IE, NF-e only: the number for an ICMS contributor, ISENTO if exempt, left out for a non-contributor."
    • changedInput schema / properties / company_id / description
      Previous value: -"UUID of the company acted for. Omit it if the connection covers a single company; else see list_authorized_companies. company_id or company_tax_id, never both."New value: +"UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
    • changedInput schema / properties / company_tax_id / description
      Previous value: -"CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit it if the connection covers a single company; else see list_authorized_companies. company_id or company_tax_id, never both."New value: +"CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
  4. Changed2 schema fields changed
    • changedInput schema / properties / company_id / description
      Previous value: -"UUID of the company this call acts for. Omit it when the connection covers a single company; with several it is required (see list_authorized_companies). Send company_id or company_tax_id, never both."New value: +"UUID of the company acted for. Omit it if the connection covers a single company; else see list_authorized_companies. company_id or company_tax_id, never both."
    • changedInput schema / properties / company_tax_id / description
      Previous value: -"CNPJ or CPF of the company this call acts for, never the recipient or a taxpayer being looked up. Omit it when the connection covers a single company; with several it is required (see list_authorized_companies). Send company_id or company_tax_id, never both."New value: +"CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit it if the connection covers a single company; else see list_authorized_companies. company_id or company_tax_id, never both."
  5. Changed1 schema field changed
    • changedOutput schema / properties / tax_id / description
      Previous value: -"CPF or CNPJ, digits only."New value: +"CPF (11 digits) or CNPJ (14 characters, unpunctuated). A CNPJ may carry letters in its first 12 positions since July 2026, so never treat it as a number."
  6. Changed34 schema fields changed
    • removedInput schema / $defs
      Removed value: -{
      -  "Address": {
      -    "description": "A plain postal address. State EX is a buyer abroad, NF-e only.",
      -    "properties": {
      -      "city": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "title": "City"
      -      },
      -      "city_code": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "title": "City Code"
      -      },
      -      "country_code": {
      -        "anyOf": [
      -          {
      -            "pattern": "^[0-9]{1,4}$",
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "BACEN country code, 1 to 4 digits. Required, and not 1058, when state is EX. Its check digit is not verified: the official table has countries whose digit does not close.",
      -        "title": "Country Code"
      -      },
      -      "country_name": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "title": "Country Name"
      -      },
      -      "neighborhood": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "title": "Neighborhood"
      -      },
      -      "number": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "title": "Number"
      -      },
      -      "state": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "title": "State"
      -      },
      -      "state_registration": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Recipient's IE (inscrição estadual), NF-e only. Send it for a recipient registered as an ICMS contributor; ISENTO for an exempt one; leave it out for a non-contributor.",
      -        "title": "State Registration"
      -      },
      -      "street": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "title": "Street"
      -      },
      -      "zip_code": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "title": "Zip Code"
      -      }
      -    },
      -    "title": "Address",
      -    "type": "object"
      -  }
      -}
    • removedInput schema / properties / address / anyOf
      Removed value: -[
      -  {
      -    "$ref": "#/$defs/Address"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / address / description
      Added value: +"Postal address: street, number, neighborhood, city, state (UF), zip_code and city_code (IBGE). An NF-e to this client needs all of them."
    • addedInput schema / properties / address / properties
      Added value: +{
      +  "city": {
      +    "default": null,
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "city_code": {
      +    "default": null,
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "country_code": {
      +    "default": null,
      +    "description": "BACEN country code, 1 to 4 digits. Required, and not 1058, when state is EX. Its check digit is not verified: the official table has countries whose digit does not close.",
      +    "pattern": "^[0-9]{1,4}$",
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "country_name": {
      +    "default": null,
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "neighborhood": {
      +    "default": null,
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "number": {
      +    "default": null,
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "state": {
      +    "default": null,
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "state_registration": {
      +    "default": null,
      +    "description": "Recipient's IE (inscrição estadual), NF-e only. Send it for a recipient registered as an ICMS contributor; ISENTO for an exempt one; leave it out for a non-contributor.",
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "street": {
      +    "default": null,
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "zip_code": {
      +    "default": null,
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  }
      +}
    • addedInput schema / properties / address / type
      Added value: +[
      +  "object",
      +  "null"
      +]
    • removedInput schema / properties / client_id / title
      Removed value: -"Client Id"
    • changedInput schema / properties / company_id / description
      Previous value: -"UUID of the company this call acts for, as list_authorized_companies shows it. Omit it when the connection covers a single company: that company is used. Required when the connection covers several — call list_authorized_companies to see them, with their ids and what each one allows. Give company_id or company_tax_id, never both."New value: +"UUID of the company this call acts for. Omit it when the connection covers a single company; with several it is required (see list_authorized_companies). Send company_id or company_tax_id, never both."
    • removedInput schema / properties / company_id / title
      Removed value: -"Company Id"
    • changedInput schema / properties / company_tax_id / description
      Previous value: -"CNPJ or CPF of the company this call acts for — the company using Stackin, never the recipient or a taxpayer being looked up. Punctuation is ignored. Omit it when the connection covers a single company: that company is used. Required when the connection covers several — call list_authorized_companies to see them, with their ids and what each one allows. Give company_id or company_tax_id, never both."New value: +"CNPJ or CPF of the company this call acts for, never the recipient or a taxpayer being looked up. Omit it when the connection covers a single company; with several it is required (see list_authorized_companies). Send company_id or company_tax_id, never both."
    • removedInput schema / properties / company_tax_id / title
      Removed value: -"Company Tax Id"
    • addedInput schema / properties / email / description
      Added value: +"Contact email, e.g. financeiro@empresa.com."
    • removedInput schema / properties / email / title
      Removed value: -"Email"
    • addedInput schema / properties / foreign_id / description
      Added value: +"Passport or other document of a buyer abroad, used instead of tax_id."
    • removedInput schema / properties / foreign_id / title
      Removed value: -"Foreign Id"
    • addedInput schema / properties / name / description
      Added value: +"Legal name (razao social) or full name."
    • removedInput schema / properties / name / title
      Removed value: -"Name"
    • addedInput schema / properties / notes / description
      Added value: +"Free text kept with the client."
    • removedInput schema / properties / notes / title
      Removed value: -"Notes"
    • addedInput schema / properties / phone / description
      Added value: +"Contact phone with area code, e.g. 11987654321."
    • removedInput schema / properties / phone / title
      Removed value: -"Phone"
    • addedInput schema / properties / state_registration / description
      Added value: +"State registration (IE), digits or ISENTO. Leave it out for a non-contributor."
    • removedInput schema / properties / state_registration / title
      Removed value: -"State Registration"
    • removedInput schema / properties / tax_id / title
      Removed value: -"Tax Id"
    • removedInput schema / title
      Removed value: -"save_clientArguments"
    • removedOutput schema / properties / address / title
      Removed value: -"Address"
    • removedOutput schema / properties / foreign_id / title
      Removed value: -"Foreign Id"
    • removedOutput schema / properties / id / title
      Removed value: -"Id"
    • removedOutput schema / properties / is_active / title
      Removed value: -"Is Active"
    • removedOutput schema / properties / last_used_at / title
      Removed value: -"Last Used At"
    • removedOutput schema / properties / name / title
      Removed value: -"Name"
    • removedOutput schema / properties / source / title
      Removed value: -"Source"
    • removedOutput schema / properties / tax_id / title
      Removed value: -"Tax Id"
    • removedOutput schema / properties / uses_count / title
      Removed value: -"Uses Count"
    • removedOutput schema / title
      Removed value: -"ClientRecord"
  7. Added

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare a non-read-only, non-destructive, non-idempotent write, so the description need not restate that. It does add real behavior beyond the annotations: duplicate saves are refused rather than silently duplicated, the returned existing id is the recovery path, and the tool never triggers issuance. It stops short of describing auth/company-scoping behavior or the returned payload (which the output schema covers).

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?

Four short sentences, front-loaded with the create-or-update purpose, then scope exclusion, then the duplicate/id recovery path, then the confirmation caveat. No restatement of parameter names and no filler.

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 12-parameter mutation tool with full schema coverage, existing annotations, and an output schema, the description covers the remaining gaps an agent needs: create vs update intent, duplicate handling, and the no-issuance side effect. Return values are handled by the output schema, so nothing critical is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description goes beyond field-level docs by explaining the client_id mode switch (create vs update in place) and by tying the duplicate-refusal return value to that parameter. The confirmation guidance also implies that inferred name/address values need human verification before they are persisted.

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?

"Save a client in the company's registry, or update a saved one" names a specific verb and resource and immediately covers both create and update modes. The second sentence scopes it against issuance tools ("it issues nothing"), so an agent can separate it from issue_invoice without reading any schema.

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?

It gives explicit routing rules: a duplicate save is refused with the existing id, and the agent should then call get_client or re-invoke with that id to update. It also adds an operational guideline ("Confirm the data with the user when any of it was inferred") that tells the agent when to pause before writing.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.