Analyze Trade and Company Data With MCP SQL

Analyzing trade and company data with MCP SQL means asking narrow questions against two fixed views, paging with page/limit, and sending the result to owner review. The reader is read-only: one SELECT, approved columns, no joins or writes.

Which questions fit the SQL reader?

Fit: selective filters on the listed columns (country plus product phrase, domain pattern plus city, shipment window plus counterparty). Poor fit: open-ended discovery, cross-view joins, full-export requests, or counts without filters. Start with trade.search or contacts.search; move to SQL when keyword search returns too much noise. View and column lists are in the MCP SQL reader.

How should a query be shaped?

Select only needed columns, filter on indexed phrases first, order deterministically, and keep limit at 25 or below while testing:

SELECT consignee_name, product_desc, actual_arrival_date
FROM bol_shipments
WHERE trade_flow = 'imports' AND product_desc LIKE '%valve%'
ORDER BY bol_number, trade_flow, actual_arrival_date

Page 2 and higher require ORDER BY with a unique tie breaker. Omit SQL LIMIT/OFFSET; the server applies page/limit. Statements must stay within 16 KiB UTF-8. Allowed functions are count, sum, avg, min, max, uniqExact, lower, upper, length, coalesce, toDate, toYear, toMonth.

How does the result become a decision?

Signals -> Leads -> Enrichment -> Decision -> Outreach -> Pipeline

Map each row to an entity (name, domain, country, trade role), check CRM matches and duplicates, and label the outcome: review for outreach, research further, route internally, or suppress. Record source and uncertainty. Results carry no total count and arrive without ranking metadata, so avoid cutoff claims such as top accounts unless the team defined the ordering.

What limits shape SQL work?

Request and usage limits depend on workspace access and the action. Check current usage with your workspace administrator. For quota_exceeded, honor Retry-After and any returned reset time, then retry with bounded backoff. Do not use parallel retries, additional clients, or new policies to evade limits.

What are common questions about MCP SQL analysis?

When should search be used instead of SQL?

Use search for keyword exploration and single-record reads; use SQL for filtered aggregation and Auditable slices.

Why did a valid-looking query fail validation?

It used a disallowed table, column, join, subquery, CTE, window, SETTINGS, FORMAT, SQL LIMIT, or positional ordering. Reduce to one SELECT on the listed view.

Why does page 2 require ORDER BY?

Page 2 and higher require ORDER BY. Use ordering supported by the tool schema and add a permitted tie breaker where available. Ties and source updates can move rows between pages; bounded results are not a complete export.

How should large results be handled?

Select fewer columns, add filters, or lower limit. Never page blindly to 20 hoping for completeness.

Do results prove buying intent?

No. They show recorded activity that justifies research. Confirm entity, role, and eligibility before outreach.

What goes into the handoff?

Question, SQL text or filter description, ordered columns, row count reviewed, entity matches, caveats, owner, and next action.