← MDO Docs

Generic preview

This is a generic version of this article — vendor-specific item codes (Datastream, Worldscope, FactSet, and others) are shown as [VENDOR SPECIFIC ITEM CODE] placeholders.

Using Surge in Snowflake

Concept Overview

The simplest way to use MDO Surge is from Snowflake CoWork in Snowsight. There is nothing to install and no token to manage — if your administrator has completed the Surge setup and granted your role access, the agent is already there.

This is the right entry point when you want to find something: an item code, an index code, a custom formula, the correct function for a data type, or a worked example you can adapt.

Back to Top

Opening the Agent

  1. In Snowsight, open AI & ML → Snowflake CoWork.
  2. Select MDO_SURGE_AGENT from the agent dropdown.
  3. Ask your question in plain English.

If MDO_SURGE_AGENT does not appear in the dropdown, either the Surge setup has not been run in your account or your Snowflake role is not in the list of roles granted access. Ask your ACCOUNTADMIN to confirm both.

Back to Top

What to Ask Surge

Surge is grounded in the MDO documentation corpus and your licensed Powerstrip catalog, so the questions it answers best are the ones that depend on knowing what MDO actually contains.

Ask aboutExample question
Item codesWhat is the Worldscope item code for annual net income?
Index codesWhat is the constituent item for the S&P 500 in Datastream?
Security identifiersWhat is the security identifier for Toyota to use for Datastream pricing?
Custom formulasWhat custom formulas are available for value factors in Worldscope data?
Function usageShow me an example of using FundamentalData with quarterly Worldscope data.
Full workflowsWrite mdosnow code to get S&P 500 monthly constituents for the last 3 years with closing prices and market cap in USD.
Code reviewValidate this code and tell me whether the items and the function match.

Two habits make a large difference to answer quality:

Name the vendor when you know it. “FactSet EPS estimate item” is a far better question than “estimates data” — the catalog contains overlapping coverage from several vendors, and naming one narrows the search immediately.

Keep index codes and data items on the same feed. If you build a universe from a QAD constituent item, ask Surge for QAD data items to populate it. Mixing feeds inside one universe produces sparse results because the security identifiers do not line up.

Back to Top

Running the Code Surge Writes

Snowflake CoWork returns code as text. To run it, either:

  • Paste it into a Snowflake notebook in the same account, or
  • Paste it into a local Python environment that has mdosnow installed.

Either way you do not need to build a connection by hand. mdosnow authenticates on import — locally it picks up the default connection from your connections.toml, and inside a Snowflake notebook it uses the notebook’s own session.

If your administrator enabled the optional Code Execution feature, Surge can run generated code inside Snowflake and hand back the resulting rows. Those tools (execute_mdo_code and check_mdo_job) are served by a separate MCP server and are reached from an MCP client rather than from the Snowflake CoWork UI. See Connecting Surge over MCP.

Back to Top

Snowflake CoWork vs. MCP

Both paths talk to the same agent and search the same corpora. The difference is where the conversation happens and what happens next.

AspectSnowflake CoWorkMCP client
Setup per userNoneConfig file plus a Programmatic Access Token
Where you workSnowsight browser tabYour editor or terminal, alongside your code
Runs the codeYou copy it into a notebook or a local environmentYour assistant can run it directly against Snowflake
Best forDiscovery, one-off lookups, ad-hoc questionsBuilding and iterating on real research scripts

Most teams use both: Snowflake CoWork for quick lookups from a browser, and an MCP client for day-to-day development.

Back to Top