Download Cortex Agent
Tool usage: see parent
agent/SKILL.md.
Workflow
Step 1: Identify Agent
- Ask for
DATABASE.SCHEMA.AGENT_NAMEIf only the name is given, find it viasnowflake_sql_execute:SHOW AGENTS LIKE '%<AGENT_NAME>%' IN ACCOUNT;
Step 2: Read from Snowflake
- Read the agent spec:
If the read succeeds but returns no YAML content, the agent has an empty spec — use YAMLcortex agent-studio agent-read --fqn <DATABASE>.<SCHEMA>.<AGENT_NAME>{}in the write step (not empty string).
Step 3: Save to Workspace
Save the spec to the workspace (auto-tracked under
cortex_project/):cortex agent-studio agent-write --yaml-content '<yaml_content from read>' --source-object <DATABASE>.<SCHEMA>.<AGENT_NAME>(For large specs, write the YAML to a temp file and pass it via
--yaml-content "$(cat /tmp/agent_spec.yaml)".--file-pathcontrols the output path insidecortex_project/, not the input.) The workspace file is generated ascortex_project/<AGENT_NAME>.agent.yaml.Confirm to the user:
Agent specification downloaded and saved to cortex_project/<AGENT_NAME>.agent.yaml.
Agent download complete.