.env file. The agent is configured with a read-only role and the remaining step is wiring the Python LLM agent to query Snowflake and return billing information for customers.
Keep secrets out of source control. Use a secrets manager or a CI/CD variable store for production credentials instead of committing
.env files..env used to connect to Snowflake:
Integration uses the same MCP toolset, the same stdio connection pattern, and the same subprocess runner as other connectors. The only differences are:
- which prebuilt tool we select (Snowflake in this case), and
- the instruction we provide to the agent.
.env loader populates them, the toolbox can connect to Snowflake immediately when it starts. The Snowflake prebuilt publishes available tools (for example, an execute_sql tool and possibly others), so in many cases you don’t need to restrict the toolset unless you want to limit agent capabilities.
Now run the agent. When the toolbox boots it connects to Snowflake and waits for the agent to ask a question. Suppose we ask:
“What’s the billing picture for cust-0003115?”The agent composes SQL against the
billing_accounts table and asks the execute_sql tool to run it. The toolbox runs the query using the read-only role and returns the result.
SQL the agent generated:
contract_end_date is returned as an ISO-like date; depending on your table schema you may see a date or timestamp. The example shows a contract ending ~34 days from today.)
Now assemble the three data layers together to get a complete picture for the account:
- From BigQuery: actual usage metrics — e.g., usage has dropped about 27 percentage points.
- From Databricks: customer support and sentiment — e.g., 5 recent tickets: 3 billing-related, 4 marked as angry, 2 still open.
- From Snowflake: billing and contract attributes — e.g., $4,000 monthly, renewing in ~34 days, plan tier: business.
- Use
contract_end_dateto identify imminent renewals. - Use usage decline and sentiment to rank accounts by risk.
- Use monthly or annual revenue to prioritize outreach efforts based on ARR impact.
- One LLM agent, a single instruction, and one runner stay constant.
- All variability comes from the prebuilt tool connectors and the systems they access (BigQuery, Databricks, Snowflake).
- This pattern lets analysts build the agent once and reuse it across multiple data systems with minimal changes.
In production, never embed credentials in repo files or container images. Use IAM roles, secrets managers (e.g., HashiCorp Vault, AWS Secrets Manager), or your CI/CD secret store to inject credentials at runtime.
- The MCP toolset and prebuilt connectors let an agent access multiple data systems via a stable protocol.
- Keep the agent simple: one agent + one instruction is often enough; expand capabilities by swapping or adding prebuilt tools.
- Use proper credential management and a read-only role for safe, auditable querying in production.