Skip to main content
Glama

save_item

Save a product or service in the catalog, or update a saved one.

Without item_id it creates, or updates the item with the same external_reference (else the same code): sending it twice never makes two. Nothing fiscal is required to save; an NF-e still needs ncm and cfop when issued. It issues nothing. Confirm the data with the user when any of it was inferred.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

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

Input Schema

NameRequiredDescriptionDefault
nbsNoService: nine-digit NBS. Only from the user or a suggest_nbs row they confirmed.
ncmNoProduct: 8 digits. Only from the user or classify_item once confirmed; never inferred.
cestNoProduct: 7 digits.
cfopNoProduct: 4 digits, e.g. 5102.
codeNoSKU, unique in the company.
gtinNoProduct: 8, 12, 13 or 14 digits, checked.
kindNoproduct (NF-e) or service (NFS-e). Required to create; a field of the other kind is refused.
unitNoUN, KG, CX...
notesNoFree text kept with it.
originNoProduct: 0 to 8; needs tax_situation.
sourceNoSet on creation only; manual by default.
item_idNoUpdate this saved item 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.
net_weightNoProduct: kg per unit, NF-e only.
unit_priceNoPrice per unit in BRL.
descriptionNoWhat is sold: at most 120 characters for a product (NF-e), 2000 for a service. Required to create.
ibs_cbs_cstNoIBS/CBS CST, 3 digits.
gross_weightNoProduct: kg per unit, NF-e only.
iss_retainedNoService: ISS retained by the customer.
service_codeNoService: LC 116 code, e.g. 1.07.
ibs_cbs_classNoIBS/CBS cClassTrib, 6 digits.
internal_codeNoService: own code, up to 20 letters or digits.
tax_situationNoProduct: ICMS CST (2 digits) or CSOSN (3).
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.
external_referenceNoAnother system's id, unique in the company.
municipal_service_codeNoService: municipal tax code, 3 digits.

Output Schema

NameRequiredDescriptionDefault
idNoPass it as item_id to issue_invoice or save_item.
ncmNo
cestNo
cfopNo
codeNo
gtinNo
kindNoproduct or service.
unitNo
sourceNo
is_activeNo
unit_priceNo
uses_countNo
descriptionNo
iss_retainedNo
last_used_atNo
service_codeNo
tax_situationNo
external_referenceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / internal_code
      Added value: +{
      +  "anyOf": [
      +    {
      +      "pattern": "^[A-Za-z0-9]{1,20}$",
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Service: own code, up to 20 letters or digits."
      +}
    • addedInput schema / properties / municipal_service_code
      Added value: +{
      +  "anyOf": [
      +    {
      +      "pattern": "^\\d{3}$",
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Service: municipal tax code, 3 digits."
      +}
    • addedInput schema / properties / nbs
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Service: nine-digit NBS. Only from the user or a suggest_nbs row they confirmed."
      +}
    • addedInput schema / properties / source
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "manual",
      +        "import",
      +        "nuvemshop",
      +        "invoice",
      +        "received"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Set on creation only; manual by default."
      +}
  2. Changed6 schema fields changed
    • 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."
    • addedInput schema / properties / gross_weight
      Added value: +{
      +  "anyOf": [
      +    {
      +      "minimum": 0,
      +      "type": "number"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Product: kg per unit, NF-e only."
      +}
    • addedInput schema / properties / ibs_cbs_class
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "IBS/CBS cClassTrib, 6 digits."
      +}
    • addedInput schema / properties / ibs_cbs_cst
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "IBS/CBS CST, 3 digits."
      +}
    • addedInput schema / properties / net_weight
      Added value: +{
      +  "anyOf": [
      +    {
      +      "minimum": 0,
      +      "type": "number"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Product: kg per unit, NF-e only."
      +}
  3. 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."
  4. Added

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations it discloses the real behavioral contract: natural-key dedup so "sending it twice never makes two", that it produces no fiscal document even though NF-e issuance later needs ncm/cfop, and that inferred values should be user-confirmed. The dedup statement sits in mild tension with idempotentHint=false, but the claim is about not duplicating rows via a key match rather than a strict same-request guarantee, so it is not a direct contradiction.

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?

Short and front-loaded: create/update semantics first, then dedup, then the fiscal caveat, then the confirmation rule. The hard-wrapped line breaks make it slightly harder to scan than a tight paragraph, but no sentence is 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?

With an output schema, annotations, and 100% schema coverage on 26 parameters, the description only needs to cover the create/update duality, identity resolution, and the fiscal scope limit, and it does all three. Nothing an agent needs to invoke this correctly 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; the description adds meaning on top by explaining that item_id switches the call to update mode with only the sent fields changing, and by defining the identity resolution order (external_reference before code). The remaining 24 domain fields are left entirely to their schema descriptions.

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 opening sentence states a specific verb and resource ("Save a product or service in the catalog, or update a saved one") and the body splits the two modes by item_id, so create-vs-update is unambiguous. "It issues nothing" explicitly separates it from the invoicing siblings, giving an agent a clean boundary without opening 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 Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explains the create/update branch (no item_id = create or upsert by external_reference, else code), tells the caller that nothing fiscal is required just to save, and instructs to confirm inferred data with the user. It stops short of naming sibling alternatives for retrieving or listing catalog items, but the when/when-not guidance is otherwise concrete.

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.