← Files SAGI ConsultasARCHIVED FILE

mcp-tools.json

18.2 KB · Nov 12, 2026 · 12:09 UTC

↓ Download file

{
  "tools": [
    {
      "name": "sagi_contexto",
      "description": "Empresa do login, todas as filiais, existencia do Financeiro 3.0 e Servico 3.0, data e limites.",
      "inputSchema": {
        "type": "object",
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {}
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "sagi_catalogo",
      "description": "Exemplos adaptaveis por periodo, filial e filtros. O catalogo orienta; SQL de leitura nao precisa estar cadastrado.",
      "inputSchema": {
        "type": "object",
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {}
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "sagi_tabelas",
      "description": "Descobre tabelas e views de negocio da empresa, por trecho do nome, em paginas de 100. Use antes de sagi_esquema.",
      "inputSchema": {
        "type": "object",
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "busca": {
            "default": "",
            "type": "string",
            "maxLength": 80
          },
          "deslocamento": {
            "default": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "sagi_esquema",
      "description": "Colunas, tipos, nulabilidade, comentarios e chaves reais de ate 20 tabelas/views do SAGI. Nao retorna credenciais.",
      "inputSchema": {
        "type": "object",
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "tabelas": {
            "minItems": 1,
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 63
            }
          }
        },
        "required": [
          "tabelas"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "sagi_consultar",
      "description": "SQL livre de leitura: SELECT, CTEs de leitura, JOIN, UNION, subconsultas, agregacoes e todos os filtros de negocio. Valida estrutura, views e funcoes; bloqueia escrita e segredos. Colunas explicitas, COUNT(*) permitido. Paginacao apos agregacao.",
      "inputSchema": {
        "type": "object",
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "sql": {
            "type": "string",
            "minLength": 1,
            "maxLength": 30000
          },
          "deslocamento": {
            "default": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          },
          "limite": {
            "default": 100,
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          }
        },
        "required": [
          "sql"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "sagi_pesagens_compra_mensal",
      "description": "Relatorio de referencia: compras ENTRADA de 2026 da FILIAL2, agrupadas por mes/produto/subcodigo/unidade, com devolucoes assinadas. Usa consulta fixa homologada. Percorra proximo_deslocamento ate null antes de totalizar. Para outras filiais, datas e filtros, use sagi_pesagens ou sagi_consultar.",
      "inputSchema": {
        "type": "object",
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "deslocamento": {
            "default": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "multipleOf": 100
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "sagi_pesagens",
      "description": "Pesagens ENTRADA/SAIDA com todos os 12 filtros documentados, em qualquer periodo e filiais da empresa. Lista ou mes/produto/unidade; preserva devolucoes com sinal. Servicos usam Servico 3.0.",
      "inputSchema": {
        "type": "object",
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "data_inicial": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "data_final": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "deslocamento": {
            "default": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          },
          "limite": {
            "default": 100,
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "movimento": {
            "type": "string",
            "enum": [
              "ENTRADA",
              "SAIDA"
            ]
          },
          "filiais": {
            "default": [],
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^(MATRIZ|FILIAL\\d+)$"
            }
          },
          "fornecedor_ou_cliente": {
            "default": null,
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "produto": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "maxLength": 30
              },
              {
                "type": "null"
              }
            ]
          },
          "subcodigo": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "maxLength": 30
              },
              {
                "type": "null"
              }
            ]
          },
          "incluir_avulsos": {
            "default": false,
            "type": "boolean"
          },
          "comprador_do_cadastro": {
            "default": false,
            "type": "boolean"
          },
          "boleto": {
            "default": null,
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "unidade_filial": {
            "default": null,
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "peso_tudo": {
            "default": false,
            "type": "boolean"
          },
          "agrupamento": {
            "default": "lista",
            "type": "string",
            "enum": [
              "lista",
              "mes_produto"
            ]
          }
        },
        "required": [
          "data_inicial",
          "data_final",
          "movimento"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "sagi_notas_fiscais",
      "description": "Notas fiscais via syg_lista_nf, com os 18 filtros da funcao e filtros de status/destinatario. Canceladas incluidas por padrao; valores de NF nao equivalem a receita recebida.",
      "inputSchema": {
        "type": "object",
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "data_inicial": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "data_final": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "deslocamento": {
            "default": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          },
          "limite": {
            "default": 100,
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "filial": {
            "default": "TODAS",
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(MATRIZ|FILIAL\\d+)$"
              },
              {
                "type": "string",
                "const": "TODAS"
              }
            ]
          },
          "campo_data": {
            "default": "emissao",
            "type": "string",
            "enum": [
              "emissao",
              "entrada_saida",
              "digitacao"
            ]
          },
          "operacao": {
            "default": "TODAS",
            "type": "string",
            "enum": [
              "TODAS",
              "ENTRADA",
              "SAIDA"
            ]
          },
          "origem": {
            "default": "TODAS",
            "type": "string",
            "enum": [
              "TODAS",
              "PROPRIA",
              "TERCEIRO"
            ]
          },
          "serie": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "maxLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "modelo": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10
              },
              {
                "type": "null"
              }
            ]
          },
          "cfop": {
            "default": null,
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "numero": {
            "default": null,
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "mostrar_documentos": {
            "default": true,
            "type": "boolean"
          },
          "incluir_clientes": {
            "default": true,
            "type": "boolean"
          },
          "incluir_fornecedores": {
            "default": true,
            "type": "boolean"
          },
          "incluir_credores": {
            "default": true,
            "type": "boolean"
          },
          "incluir_canceladas": {
            "default": true,
            "type": "boolean"
          },
          "finalidade": {
            "default": null,
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "filtro_interno": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "chave": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{44}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "maxLength": 30
              },
              {
                "type": "null"
              }
            ]
          },
          "destinatario": {
            "default": null,
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "data_inicial",
          "data_final"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "sagi_financeiro30",
      "description": "Parcelas pagar/receber exclusivamente do Financeiro 3.0. Saldo de listagem: parcela + juros - descontos - pago, sem exclusoes de dashboard nem variacao cambial. Filtros livres no SQL via sagi_consultar.",
      "inputSchema": {
        "type": "object",
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "data_inicial": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "data_final": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "deslocamento": {
            "default": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          },
          "limite": {
            "default": 100,
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "campo_data": {
            "default": "vencimento",
            "type": "string",
            "enum": [
              "lancamento",
              "vencimento",
              "pagamento"
            ]
          },
          "tipo": {
            "default": "TODOS",
            "type": "string",
            "enum": [
              "P",
              "R",
              "TODOS"
            ]
          },
          "filiais": {
            "default": [],
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "pessoa_orides": {
            "default": null,
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "modulo": {
            "default": null,
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "documento": {
            "default": null,
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "saldo": {
            "default": "todos",
            "type": "string",
            "enum": [
              "todos",
              "positivo",
              "zero",
              "negativo"
            ]
          }
        },
        "required": [
          "data_inicial",
          "data_final"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "sagi_servico30",
      "description": "Cabecalhos de medicoes exclusivamente do Servico 3.0, por emissao, filial, cliente, status e aprovacao. Nao fatura e nao infere recebimento financeiro.",
      "inputSchema": {
        "type": "object",
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "data_inicial": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "data_final": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "deslocamento": {
            "default": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          },
          "limite": {
            "default": 100,
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "filiais": {
            "default": [],
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^(MATRIZ|FILIAL\\d+)$"
            }
          },
          "cliente": {
            "default": null,
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "maxLength": 30
              },
              {
                "type": "null"
              }
            ]
          },
          "aprovada": {
            "default": null,
            "type": [
              "boolean",
              "null"
            ]
          }
        },
        "required": [
          "data_inicial",
          "data_final"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false
      }
    }
  ]
}

SHA-256: a3cc14021f4007e18bb03fb055cbec1003fab6819245d15c668daba35bfec706