describe_table | Describe a Sankhya table: primary key, the entity name to use with write_record, and its columns with SQL type and data dictionary label (TDDCAM), including the customer’s custom AD_* fields. search filters columns by name or label (e.g. “pipedrive”, “AD_”, “data”); big tables… | table (string, required), search (string) |
find_partner | Find Sankhya partners (customers/suppliers, table TGFPAR) by name, trade name, CNPJ/CPF, or code, and return their CODPARC. Use this to turn a CRM lead/organization name into the CODPARC needed for a sales order. Exact CNPJ/CPF or code matches come first. | search (string, required), limit (integer) |
get_order | Get a Sankhya sales order / note by NUNOTA: main header fields (TGFCAB) and its items (TGFITE). Returns {“found”: false} when it does not exist. | nunota (integer, required) |
list_tables | List Sankhya database tables with their data dictionary description (TDDTAB). search filters by table name or description (e.g. “parceiro”, “TGFCAB”, “pedido”). Main tables: TGFPAR partners, TGFCAB note/order headers, TGFITE note/order items, TGFPRO products, TGFFIN financial… | limit (integer), search (string) |
read_table | Read rows from a Sankhya table (e.g. TGFPAR, TGFCAB, TGFITE, TGFPRO). - columns: column names to return (default: all; prefer naming them, TGFCAB has ~470). - filters: equality filters {column: value}, values escaped safely (null -> IS NULL). - where: optional extra SQL Server c… | table (string, required), limit (integer), where (string), columns (array), filters (object), order_by (array) |
run_query | Run a read-only SQL Server query (SELECT or WITH) on the Sankhya database, for joins and aggregations read_table cannot express. One statement only; data-changing statements are refused. Use TOP to bound large results; at most limit rows are returned (max 5000). | sql (string, required), limit (integer) |