DESCRIBE AGENT¶
Describes the properties of a Cortex Agent.
DESCRIBE can be abbreviated to DESC.
- See also:
Syntax¶
{ DESC | DESCRIBE } AGENT <name>
Parameters¶
nameSpecifies the name for the agent to describe.
If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive.
For more information, see Identifier requirements.
Output¶
The command output provides Cortex Agent properties and metadata in the following columns:
Column |
Description |
|---|---|
|
Name of the agent. |
|
Database containing the agent. |
|
Schema containing the agent. |
|
Owner role of the agent. |
|
Comment text for the agent. |
|
Agent profile JSON (display_name, avatar, color). |
|
Complete YAML specification of the agent. |
|
Timestamp when the agent was created. |
Access control requirements¶
A role used to execute this SQL command must have at least one of the following privileges at a minimum:
Privilege |
Object |
Notes |
|---|---|---|
Any one of these privileges: OWNERSHIP, USAGE, MONITOR or OPERATE |
Agent |
The USAGE privilege on the parent database and schema are required to perform operations on any object in a schema. Note that a role granted any privilege on a schema allows that role to resolve the schema. For example, a role granted CREATE privilege on a schema can create objects on that schema without also having USAGE granted on that schema.
For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.
For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.
Usage notes¶
To post-process the output of this command, you can use the pipe operator (
->>) or the RESULT_SCAN function. Both constructs treat the output as a result set that you can query.The output column names for this command are generated in lowercase. If you consume a result set from this command with the pipe operator or the RESULT_SCAN function, use double-quoted identifiers for the column names in the query to ensure that they match the column names in the output that was scanned. For example, if the name of an output column is
type, then specify"type"for the identifier.
Examples¶
Describe a Cortex Agent named MY_AGENT1 in the TEST_DATABASE database and TEST_SCHEMA schema:
DESCRIBE AGENT mydb.myschema.my_agent;
The statement in the example prints the following output:
+--------------+---------+---------------+-------------+-----------+-----------------------+-------------------------------------+
| name | database_name | schema_name | owner | comment | profile | agent_spec | created_on |
|--------------+---------+---------------+-------------+-----------+-----------------------+-------------------------------------|
|| TEST_AGENT | EXAMPLE_DB | AGENTS | TEST_ROLE | null | {"display_name":"test"} | "{\"models\":{\"orchestration\":\"llama3.1-70B\"},\"nested\":{\"key\":\"value\"}},\"orchestration\":{\"budget\":{\"seconds\":30,\"tokens\":16000}},\"instructions\":{\"response\":\"You will respond in a friendly but concise manner\",\"orchestration\":\"For any revenue question use Analyst; for policy use Search\",\"system\":\"You are a friendly agent.\",\"sample_questions\":[{\"question\":\"question 1\"},{\"question\":\"question 2\"},{\"question\":\"question 3\"}]},\"tools\":[{\"tool_spec\":{\"type\":\"cortex_analyst_text_to_sql\",\"name\":\"Analyst1\",\"description\":\"test\"}},{\"tool_spec\":{\"type\":\"cortex_analyst_sql_exec\",\"name\":\"SQL_exec1\"}},{\"tool_spec\":{\"type\":\"cortex_search\",\"name\":\"Search1\"}},{\"tool_spec\":{\"type\":\"web_search\",\"name\":\"web_search_1\"}},{\"tool_spec\":{\"type\":\"generic\",\"name\":\"get_weather\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\",\"description\":\"The city and state\"}},\"required\":[\"Location\"]}}}],\"tool_unable_to_answer\":\"I don't know the answer to that\",\"tool_resources\":{\"Analyst1\":{\"semantic_model_file\":\"stage1\"},\"Analyst2\":{\"semantic_view\":\"db.schema.semantic_view\"},\"Search1\":{\"name\":\"db.schema.service_name\",\"Max_results\":\"5\",\"filter\":{\"@eq\":{\"region\":\"North America\"}},\"Title_column\":\"<title_name>\",\"ID_column\":\"<column_name>\"},\"SQL_exec1\":{\"Name\":\"my_warehouse\",\"Timeout\":\"30\",\"AutoExecute\":\"true\"},\"web_search\":{\"name\":\"web_search_1\",\"Function\":\"db/schema/search_web\"}}}" | 2025-09-15 17:04:37.263 +0000 |
+--------------+---------+---------------+-------------+-----------+-----------------------+-------------------------------------+
The following example describes an agent in the current schema:
DESCRIBE AGENT my_agent;
The following example describes the agent as a resource in JSON format:
DESCRIBE AS RESOURCE AGENT my_agent;