The curate-context skill in Google Cloud Data Agent Kit lets you create, import,
edit, and publish Knowledge Catalog (formerly Dataplex Universal Catalog) context sets from your coding
environment. You can manage table guidance, business definitions, and verified
SQL as local Markdown files in a version-control system (such as Git). Those
files ground AI agents in consistent domain knowledge. Supported environments
include Antigravity CLI, Claude Code, Codex CLI, Visual Studio Code
(VS Code), and other VS Code-based IDEs (such as Antigravity IDE and Cursor).
For the complete list of supported environments, see Install
Data Agent Kit.
This guide is for data engineers, analytics engineers, and data stewards who want to author and publish context sets locally with a coding agent or IDE. Context sets built with Data Agent Kit share the same entry hierarchy as context sets built by Knowledge Studio enrichment tasks, so both approaches are interoperable. For context set concepts and an authoring comparison, see Context sets overview. To run scheduled enrichment in the Google Cloud console, see About enrichment tasks.
Key concepts
The following table describes the four components you use to curate context sets locally:
| Component | Role |
|---|---|
| Data Agent Kit | Data Agent Kit provides a plugin for CLI coding agents and an extension for VS Code-based IDEs. These integrations connect your development environment to Google Cloud data services through reusable agent workflows called skills. Data Agent Kit comes preinstalled in Cloud Shell and Cloud Workstations. For more information, see Data Agent Kit overview. |
curate-context skill
|
The curate-context skill directs your coding agent to inspect live schemas and local documentation,
author context set files, and validate SQL before publishing.
For more information, see the curate-context
skill
in the data-agent-kit-plugin repository on GitHub. |
| Open Knowledge Format bundle | An Open Knowledge Format (OKF) v0.2 bundle is a local bundle/ directory that contains Markdown
files with YAML frontmatter and a _links.yaml file. Keep repository files, such as README.md and
CONTRIBUTING.md files, outside the bundle/ directory. For more information, see the
Open Knowledge Format repository on
GitHub. |
kcmd CLI
|
The kcmd CLI is the command-line tool in the scoped @google-cloud/kcmd npm package. The CLI pulls
remote context sets locally, previews diffs with the --dry-run flag, and pushes approved bundles to
Knowledge Catalog. The tool also manages the root catalog.yaml file. Don't
edit the catalog.yaml file by hand. For more information, see Metadata as
Code in the
knowledge-catalog repository on GitHub. |
Limitations
The curate-context skill has the following limitations:
- Out-of-scope operations. The skill doesn't certify entries, modify
Identity and Access Management (IAM) allow policies, create or edit business glossary
terms in
@dataplex(you can still link to existing terms), write aspects onto source entries (such as@bigquery), author parameterizedquery-templateentries, createschema-joinentry links, or author Open Semantic Interchange (OSI) semantic ontology YAML files. - Location compatibility. Each external
referenceordefinitionentry link target must match the context set's location or be aglobalbusiness glossary term. This rule applies to regional (for example,us-central1), multi-region (for example,usoreu), andglobalcontext sets. For example, aglobalor multi-region context set can't create entry links to a table inus-central1. To document tables across multiple locations, create a separate context set for each location. Otherwise, keep each table'sresource:frontmatter field and omit cross-location entry links from thebundle/_links.yamlfile. - Quotas. Large context sets (100 or more entries, or 200 or more links)
are subject to regional per-user entry link request quotas. Focus the
bundle/_links.yamlfile on primaryreference,definition, andrelatedlinks rather than dense all-pairs links. For more information, see Quotas and limits. - No built-in version history or Git sync.
Knowledge Catalog stores only the most recently
pushed state and doesn't sync with Git automatically. Commit the root
catalog.yamlfile andbundle/directory to your own Git repository for pull-request reviews and revision history. - Billing. Catalog lookups, queries, and writes run under your
Google Cloud credentials and project. SQL compile checks read no table
rows: BigQuery dry runs incur no query charges, and query plans or
EXPLAINchecks use existing provisioned instances (standard instance charges apply). Optional live test queries (scoped with aggregates or a row limit) incur standard query charges, and pushed entries incur standard Knowledge Catalog metadata storage charges. Separate subscription or model-usage charges might apply if you use a third-party coding agent. For details, see Knowledge Catalog pricing and BigQuery pricing.
Before you begin
-
Install the Google Cloud CLI.
-
Configure the gcloud CLI to use your federated identity.
For more information, see Sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init -
Create or select a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Create a Google Cloud project:
gcloud projects create PROJECT_ID
Replace
PROJECT_IDwith a name for the Google Cloud project you are creating. -
Select the Google Cloud project that you created:
gcloud config set project PROJECT_ID
Replace
PROJECT_IDwith your Google Cloud project name.
-
Verify that you have the permissions required to complete this guide.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Dataplex API, if it is not already enabled:
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.gcloud services enable dataplex.googleapis.com
-
Create local authentication credentials for your user account:
gcloud auth application-default login
If an authentication error is returned, confirm that you have signed in to the gcloud CLI with your federated identity.
-
Optional: Enable the APIs for any data sources that you plan to document in the same project. For example, enable the BigQuery API:
gcloud services enable bigquery.googleapis.com
Enabling the Dataplex API automatically enables the Knowledge Catalog remote Model Context Protocol (MCP) server.
Required roles
To work with remote context sets using Data Agent Kit, you need the roles required for all tasks plus the context set role that matches your workflow. Optional roles apply only if you validate BigQuery SQL or link existing business glossary terms.
Roles for all tasks
To get the permissions that you need to connect to Google Cloud and inspect catalog metadata with Data Agent Kit, ask your administrator to grant you the following IAM roles:
- MCP Tool User (
roles/mcp.toolUser) on the project where you run MCP tool calls - Service Usage Consumer (
roles/serviceusage.serviceUsageConsumer) on the quota project - Dataplex Catalog Viewer (
roles/dataplex.catalogViewer) on the project hosting your source entries (and the context set project, if reading entry links)
These predefined roles contain the permissions required to connect to Google Cloud and inspect catalog metadata with Data Agent Kit. To see the exact permissions that are required, expand the Required permissions section:
Required permissions
The following permissions are required to connect to Google Cloud and inspect catalog metadata with Data Agent Kit:
-
Call remote MCP servers:
mcp.tools.call -
Consume API quota with Application Default Credentials (ADC):
serviceusage.services.use -
Search and inspect catalog entries, entry links, schemas, and glossary terms:
-
dataplex.projects.search -
dataplex.entries.get -
dataplex.entries.list -
dataplex.entryGroups.get -
dataplex.entryGroups.list -
dataplex.entryLinks.get -
dataplex.glossaries.get -
dataplex.glossaryTerms.get
-
Roles for context sets
To get the permissions that you need to export, create, update, or share context sets, ask your administrator to grant you the following IAM roles:
-
Export an existing context set read-only without edits:
Dataplex Content User (
roles/dataplex.contentUser) on the context set -
Create a context set on first push:
Dataplex Content Creator (
roles/dataplex.contentCreator) on the project hosting the context set -
Update entries and links in an existing context set:
Dataplex Content Editor (
roles/dataplex.contentEditor) on the context set -
Grant access on an existing context set that you didn't create:
Dataplex Content Admin (
roles/dataplex.contentAdmin) on the context set
These predefined roles contain the permissions required to export, create, update, or share context sets. To see the exact permissions that are required, expand the Required permissions section:
Required permissions
The following permissions are required to export, create, update, or share context sets:
-
Export an existing context set read-only without edits:
-
dataplex.entryGroups.getContextSet -
dataplex.entries.getContext -
dataplex.entries.listContext
-
-
Create a context set on first push:
-
dataplex.entryGroups.createContextSet -
dataplex.entryGroups.list
-
-
Update entries and links in an existing context set:
-
dataplex.entryGroups.getContextSet -
dataplex.entryGroups.updateContextSet -
dataplex.entries.createContext -
dataplex.entries.getContext -
dataplex.entries.listContext -
dataplex.entries.updateContext -
dataplex.entries.deleteContext -
dataplex.entryLinks.create -
dataplex.entryLinks.delete -
dataplex.entryLinks.get -
dataplex.entryLinks.update -
dataplex.entries.link -
dataplex.entryGroups.useReferenceEntryLink -
dataplex.entryGroups.useRelatedEntryLink -
dataplex.entryGroups.useDefinitionEntryLink
-
-
Grant access on an existing context set that you didn't create:
-
dataplex.entryGroups.getIamPolicy -
dataplex.entryGroups.setIamPolicy
-
The following context set access rules apply:
- When
kcmd pushcreates a context set for the first time, Knowledge Catalog automatically grants you the Dataplex Content Admin (roles/dataplex.contentAdmin) role on that context set. This role includes all Dataplex Content Editor (roles/dataplex.contentEditor) and Dataplex Content User (roles/dataplex.contentUser) permissions. - You don't need write or link permissions on the source
@bigquerysystem entry group to createreferencelinks to your tables. - The Dataplex Content User (
roles/dataplex.contentUser) role doesn't includedataplex.entryLinks.get. To read entry links in a context set read-only, also grant Dataplex Catalog Viewer (roles/dataplex.catalogViewer) on the context set project.
Optional roles for data sources and glossaries
To get the permissions that you need to validate BigQuery SQL or link existing glossary terms, ask your administrator to grant you the following IAM roles:
-
Run compile checks and optional test queries on BigQuery tables:
- BigQuery Job User (
roles/bigquery.jobUser) on the billing project - BigQuery Data Viewer (
roles/bigquery.dataViewer) on the source BigQuery datasets or tables
- BigQuery Job User (
-
Link context set entries to existing glossary terms:
Dataplex Catalog Editor (
roles/dataplex.catalogEditor) on the project hosting the glossary
For more information about granting roles, see Manage access to projects, folders, and organizations.
These predefined roles contain the permissions required to validate BigQuery SQL or link existing glossary terms. To see the exact permissions that are required, expand the Required permissions section:
Required permissions
The following permissions are required to validate BigQuery SQL or link existing glossary terms:
-
Run compile checks and optional test queries on BigQuery tables:
-
bigquery.jobs.create -
bigquery.tables.get -
bigquery.tables.getData
-
-
Link context set entries to existing glossary terms:
dataplex.glossaryTerms.use
You might also be able to get these permissions with custom roles or other predefined roles.
If you document non-BigQuery data sources (such as Spanner, Cloud SQL, AlloyDB for PostgreSQL, BigLake, or Dataproc Metastore), you also need read-only viewer access on those source resources. For full permission details, see the Required roles section of Manage context sets.
Install and configure Data Agent Kit
Install version 1.3.0 or later of the Data Agent Kit plugin or
extension, and enable Knowledge Catalog to configure the curate-context
skill and remote MCP server (dak-kc in the CLI plugin,
datacloud_knowledge_catalog_remote in the IDE extension).
Select your environment:
Antigravity CLI
Install the plugin:
agy plugin install \ https://github.com/GoogleCloudPlatform/data-agent-kit-pluginStart Antigravity CLI in your terminal:
agyIn the agent prompt, configure Data Agent Kit:
/dak:dak-setupFollow the setup prompts described after the tabs and confirm the summary to save your configuration.
Restart Antigravity CLI to load the saved configuration.
Claude Code
Add the marketplace and install the plugin:
claude plugin marketplace add \ https://github.com/GoogleCloudPlatform/data-agent-kit-plugin claude plugin install dak@dak-marketplaceStart Claude Code in your terminal:
claudeIn the agent prompt, configure Data Agent Kit:
/dak:dak-setupFollow the setup prompts described after the tabs and confirm the summary to save your configuration.
Restart Claude Code to load the saved configuration.
Codex CLI
Add the marketplace and install the plugin:
codex plugin marketplace add GoogleCloudPlatform/data-agent-kit-plugin codex plugin add dak@dak-marketplaceStart Codex CLI with the sandbox temporarily disabled so setup can configure MCP servers:
codex -s danger-full-accessIn the agent prompt, configure Data Agent Kit:
$dak:dak-setupFollow the setup prompts described after the tabs and confirm the summary to save your configuration.
Exit the unsandboxed session and restart Codex CLI with the default sandbox enabled (
codex).
VS Code-based IDEs
- In VS Code, Antigravity IDE, or Cursor, press Control+Shift+X (or Command+Shift+X on macOS) to open Extensions.
- Search for
Google Cloud Data Agent Kit, and then click Install. - Click the Google Cloud Data Agent Kit sign-in link in the status bar and sign in using your browser.
- On the Select services page, select Knowledge Catalog and any data sources you plan to document, and then click Next.
When you run dak-setup in a CLI agent, answer these prompts in order before
confirming the summary:
- Project ID. Your Google Cloud project ID (not the display name or project number), or confirm the default from the Google Cloud CLI.
- Region. Your Google Cloud region (for example,
us-central1, not a zone likeus-central1-a), or confirm the default. - Service integrations. Knowledge Catalog and any data sources you plan to document (for example, BigQuery, AlloyDB, Cloud SQL, or Spanner).
For other Agent Plugins-compatible agents, point your plugin install command at
https://github.com/GoogleCloudPlatform/data-agent-kit-plugin. For additional
installation details, see Install
Data Agent Kit and the
Data Agent Kit plugin
repository on
GitHub.
Optional: Install the kcmd CLI
To pull existing context sets from or publish context sets to
Knowledge Catalog, install the scoped
@google-cloud/kcmd package. This CLI requires Node.js 22.12 or later. You can
skip this procedure if you only plan to author standalone local OKF files. If
you target a remote context set without installing kcmd first, the coding
agent detects the missing CLI when presenting the authoring plan and asks for
confirmation before installing it. For Node.js installation packages, see
Download Node.js on the Node.js website.
Verify that Node.js 22.12 or later is installed:
node --versionInstall the scoped
@google-cloud/kcmdpackage globally:npm install -g @google-cloud/kcmdInstall only the scoped
@google-cloud/kcmdpackage. Don't install an unscopedkcmdpackage from npm or PyPI.Verify that
kcmdis available on yourPATH:kcmd --version
For standalone kcmd CLI usage outside a coding agent, see Metadata as
Code
in the knowledge-catalog repository on GitHub.
Gather your source materials
The curate-context skill is designed to ground entries in your provided
sources instead of guessing schemas or metrics. Review the agent's authoring
plan and generated files before publishing. If your prompt provides no inputs,
the agent stops and asks before running. Gather the inputs relevant to your
task:
- Data source tables or datasets. Table names or search topics in BigQuery, Spanner, BigLake (Apache Iceberg REST catalog, Lakehouse runtime catalog for Apache Hive, and Delta Sharing), Cloud SQL (MySQL, PostgreSQL, and SQL Server), AlloyDB, or Dataproc Metastore (Hive Metastore). Omit for documents-only context sets.
- Local documents. Markdown, YAML, or plain text files (such as standard operating procedures, metric definitions, policy updates, or caveat notes).
- Verified SQL queries. SQL files with executable queries that use literal
values instead of parameterized
@paramplaceholders. - Existing OKF v0.2 bundle (for imports). A local folder containing
Markdown files with
type:frontmatter, anindex.mdfile, or a_links.yamlfile. - Existing business glossary terms (optional). Published terms in
Knowledge Catalog. The agent finds and adds
definitionlinks to matching terms automatically without editing or creating glossary terms.
In the example prompts in this guide, replace illustrative values
(cymbal-analytics, sales-analytics, revenue-context, table names, and
paths such as ./docs/revenue_definitions.md, ./sql/revenue_queries.sql, and
./revenue-okf/) with your own resources and local folders.
Create a context set from tables and documents
You can author a context set from one or more data sources, business documents only, verified SQL queries, or a combination of those inputs. For supported sources and file types, see the Gather your source materials section of this document.
To create a context set from tables and documents, follow these steps:
Open a terminal in your project directory containing any local business documents or verified SQL files, and start your coding agent.
Enter a prompt naming the source tables, local files, and target context set settings (project, location, and context set ID), or ask for local files only:
Build a Knowledge Catalog context set named sales-analytics in project cymbal-analytics (location us) from BigQuery tables cymbal-analytics.crm.accounts and cymbal-analytics.billing.mrr_movements, using ./docs/revenue_definitions.md and ./sql/revenue_queries.sql.If you name tables loosely (for example, "our revenue tables"), the skill searches Knowledge Catalog, checks live schemas, and flags lookalike, staging, or deprecated tables for you to confirm.
Review the authoring plan the agent presents before writing local files. Exact formatting varies by agent and model, and the plan typically includes these items:
- Missing
kcmdnotice (conditional). Prompt to approve installing@google-cloud/kcmd(npm install -g @google-cloud/kcmd) if missing. - Target layout. Project, location, context set ID (lowercase letters,
digits, and hyphens only), display name, description, and workspace
bundle/path. - Discovered assets and glossary terms. Inspected tables with verified
keys, excluded lookalike or staging tables, and matching existing
glossary terms for
definitionlinks. - Planned OKF files and links. Index, table context, and concept
pages; SQL queries queued for the
queriesaspect; andreference,definition, andrelatedlinks in thebundle/_links.yamlfile. - Conflicts and open questions. Source disagreements, declined out-of-scope requests (such as creating glossary terms), undocumented column or filter questions, and an optional test query against live table data.
- Missing
Reply to approve the authoring plan and explicitly answer each open question (such as
kcmdinstallation, filter rules, and whether to run a live test query).Wait several minutes while the agent authors and validates
bundle/(installingkcmdfirst if confirmed). A new context set uses a progressive-disclosure layout similar to the following example:bundle/ ├── agents.md # Root router (Context Set) ├── assets.md # Data assets index ├── assets/bigquery/cymbal-analytics/ │ ├── crm.md # Dataset index │ ├── crm/accounts.md # Table context page │ ├── billing.md # Dataset index │ └── billing/mrr_movements.md # Table context and queries ├── documents.md # Business documents index ├── documents/net-revenue-retention.md # Concept document └── _links.yaml # Entry linksThe skill instructs your coding agent to document columns from your provided sources rather than silently inventing descriptions from column names. The agent stores concrete, executable SQL queries with literal values in each table page's
dataplex-types.global.queriesaspect (userManaged: true) and compile-checks them before publishing without reading table rows (BigQuery dry run, Spanner query plan, orEXPLAINfor Cloud SQL MySQL and PostgreSQL and AlloyDB).Review the validation summary and publish preview before pushing:
- Validation status. Local bundle check,
kcmd push --dry-runcounts (create, update, delete), SQL compile-check results, and any requested live test query output. - Change summary. Added, updated, and deleted entries,
queriesaspect updates, entry link changes in thebundle/_links.yamlfile (including any omitted cross-location links), and secondary writes such as updating the catalog search summary. - Findings. Unresolved source conflicts, ripple mismatches, declined out-of-scope requests, and undocumented columns without grounded descriptions.
Optional: To catch runtime errors (such as empty results or divide-by-zero), ask the agent to run a test query against live table data using aggregates or a row limit (standard query charges apply).
- Validation status. Local bundle check,
If you track your workspace in Git, commit or back up your files before publishing, because
kcmd pushcan rerender local pages or move links into frontmatter.Reply to approve publishing (1 to 2 minutes while
kcmd pushruns, reports any rewritten local files, and verifies live entries). The verification summary ends with a line similar to the following:Published context set: projects/cymbal-analytics/locations/us/entryGroups/sales-analytics
For additional verification steps, see the Verify and consume your context set section of this document.
Import or export an OKF bundle
Because OKF v0.2 stores catalog knowledge as plain Markdown files with YAML frontmatter, you can import existing bundles into Knowledge Catalog or export published context sets to local OKF files.
Import an existing OKF bundle
You can import and publish an existing OKF v0.2 folder (Markdown files with
type: frontmatter, an index.md file, or a _links.yaml file) in place
without rebuilding entries by hand.
To import an existing OKF bundle, follow these steps:
- Open your coding agent in the directory containing your OKF bundle.
Prompt the agent to import your folder into a target context set, replacing the example path, IDs, and location with your own values:
Import the OKF bundle in ./revenue-okf/ into a Knowledge Catalog context set named revenue-context in project cymbal-analytics (location us) and enrich thin table pages with verified BigQuery schemas.When the agent presents the import plan, select a layout option and answer any open questions (such as whether to run an optional live test query):
- Convert to the progressive-disclosure layout (recommended). Adds the
agents.md,assets.md, anddocuments.mdfiles with container indexes in place. Folds concrete SQL andAttested Computationpages into each table page'squeriesaspect (preserving attribution) and removes replaced files (such as folded pages and an untyped rootindex.mdfile). Commit or back up your folder first. - Keep your current directory structure as-is. Keeps existing folders,
custom paths,
Attested Computationpages, and non-Markdown assets unchanged.
Both modes link
bundleto your folder in place (unless you ask for a copy) and enrich thin table pages in append-only mode with verified schemas. The skill is designed to preserve upstream OKF v0.2 metadata (sources,usage_window,generated,verified,status,stale_after, and custom extension keys) and footnotes without adding unverified certification metadata.- Convert to the progressive-disclosure layout (recommended). Adds the
Wait 1 to 3 minutes while the agent enriches and validates the bundle.
Review the validation summary and publish preview, and commit or back up your folder if needed.
Reply to approve publishing to Knowledge Catalog.
Export a remote context set locally
Download an existing remote context set (including sets created by Knowledge Studio enrichment tasks) to local OKF files for inspection, backup, or Git version control without modifying the pulled content.
To run a read-only export, follow these steps:
Open your coding agent in an empty directory and ask for a read-only export:
Export the existing Knowledge Catalog context set sales-analytics from project cymbal-analytics (location us) into a local OKF folder without making edits.Approve the target context set and destination directory when prompted.
The agent runs kcmd init (and kcmd pull if needed) to populate bundle/,
lists any structural or semantic findings in a local summary without rewriting
pulled files, and makes no remote writes.
Edit and maintain an existing context set
Refine a context set with natural-language prompts or by editing local OKF
files directly. If local files exist and you don't ask to pull or push, the
curate-context skill edits them in place without remote catalog calls.
To update a context set and publish changes, follow these steps:
- Open your coding agent in your existing workspace (or in an empty directory when pulling a remote context set for the first time).
Describe the targeted update and cite any updated source files:
Pull the sales-analytics context set from project cymbal-analytics (location us). Update the net-revenue-retention definition to exclude internal test accounts (test_account_flag = FALSE) based on ./docs/q4_policy_update.md, check for affected queries, and publish the update.Review the proposed edit plan:
- Inspect ripple effects flagged across
bundle/and entry links (concept documents, table pages, and SQL queries affected by the change), and choose whether to include those updates. - Confirm that untouched entries remain unchanged, including
Context Overlaypages from Knowledge Studio enrichment and existingquery-templateentries.
- Inspect ripple effects flagged across
Reply to approve the edit plan.
Review the validation summary and publish preview. If the preview shows unexpected updates or deletions, a teammate might have published changes since your last pull. Don't approve the push; ask the agent to back up your local edits, pull the published version from Knowledge Catalog, reapply your changes, and run another publish preview.
Reply to approve pushing to Knowledge Catalog.
Grant access to a published context set
Context sets don't inherit read access from standard project viewer roles or
Dataplex Catalog Admin (roles/dataplex.catalogAdmin). Because
curate-context doesn't modify IAM allow policies, you must
explicitly grant reader access after publishing so teammates and downstream
agents can read the entries. If you didn't create the context set yourself, you
need the Dataplex Content Admin (roles/dataplex.contentAdmin) role on the
context set to update its allow policy.
Grant the Dataplex Content User (roles/dataplex.contentUser) role on your
context set entry group using the gcloud dataplex entry-groups
add-iam-policy-binding command:
gcloud dataplex entry-groups add-iam-policy-binding CONTEXT_SET_ID \
--location=LOCATION \
--project=PROJECT_ID \
--member=PRINCIPAL \
--role=roles/dataplex.contentUser
Replace the following:
CONTEXT_SET_ID: the ID of your context set entry groupLOCATION: the Google Cloud location of the context set, such asusorus-central1PROJECT_ID: the ID of the project hosting the context setPRINCIPAL: the principal to grant access to, such asgroup:analysts@example.comoruser:dana@example.com
To grant roles through the Google Cloud console, open the Knowledge Studio
page, select Context sets, open your context set, and click Permissions
on the top action bar. For command reference details, see the gcloud dataplex
entry-groups
add-iam-policy-binding
command. For more information about viewing and managing context sets in the
Google Cloud console, see Manage context
sets.
Verify and consume your context set
After you publish your context set and grant reader access, verify that it's discoverable and returns grounded domain context:
Inspect in Knowledge Studio. In the Google Cloud console, open Knowledge Studio, select Context sets, and open your context set to verify its entries and links. Click Explore on the top action bar to inspect the context graph.
Optional: List published entries with the gcloud CLI. Check your entry group using the same
CONTEXT_SET_ID,LOCATION, andPROJECT_IDvalues from the previous section:gcloud dataplex entries list \ --entry-group=CONTEXT_SET_ID \ --location=LOCATION \ --project=PROJECT_IDTest retrieval with the
discover-assetsskill. Usecurate-contextto author and publish, and use the companiondiscover-assetsskill (bundled in Data Agent Kit) to query your context set. In a fresh agent prompt, ask a business question such as one of the following:- Metric definitions and filter rules.
Which tables and filters should I use to calculate net revenue retention? - Table caveats and lookalike exclusions.
Which accounts table is authoritative for reporting, and which table should I avoid? - Grounded SQL generation.
Write a BigQuery SQL query for monthly expansion MRR using our curated revenue context.
The
discover-assetsskill prioritizes context set entries (parent_entrygroup_type=context-set) throughsearch_entriesand callslookup_contexton the remote MCP server so the agent grounds answers and SQL in your curated definitions.- Metric definitions and filter rules.
Applications such as Gemini Enterprise and custom agents can also read
published context sets through MCP or Knowledge Catalog
APIs. For command details, see the gcloud dataplex entries
list command. To delete a test
context set, see the Delete a context set section of Manage context
sets. For more
information, see Explore data assets in Knowledge
Studio, Retrieve context for data
assets, and Use the
Knowledge Catalog remote MCP
server.
Troubleshoot
Use the following solutions to resolve common kcmd and remote MCP server
issues when curating context sets.
Authentication errors during kcmd or MCP tool calls
If kcmd or remote MCP server tool calls fail to authenticate after initial
setup, your cached session tokens might be expired. To recover, exit your coding
agent, refresh both user credentials and ADC, and restart your agent:
gcloud auth login && gcloud auth application-default login
SERVICE_DISABLED or permission error for the target project
If the agent reports that the Dataplex API isn't enabled on the target
project (SERVICE_DISABLED or permission denied), the skill stops without
switching projects or modifying local files. Complete one of the following
actions:
- Confirm that you replaced the example project ID (
cymbal-analytics) with your own project ID. Enable the Dataplex API in your target project:
gcloud services enable dataplex.googleapis.com \ --project=PROJECT_IDReplace
PROJECT_IDwith your target project ID.Reply to tell the agent to use a different target project or to edit the bundle locally without publishing.
HTTP 403 Forbidden error immediately after the first push
When kcmd push creates a context set for the first time,
Knowledge Catalog automatically grants your account the
Dataplex Content Admin (roles/dataplex.contentAdmin) role on that entry
group. If read calls return an HTTP 403 Forbidden status code immediately
after the first push, wait 1 to 3 minutes for permission propagation and retry
(kcmd push waits up to 120 seconds by default).
Publish preview marks published entries as uncreated after a Git clone
The kcmd CLI compares local bundle/ files against
Knowledge Catalog using the scope field in the root
catalog.yaml file rather than hidden local state. After a fresh Git clone, a
publish preview (kcmd push --dry-run) treats published entries as uncreated in
these cases:
- The
catalog.yamlfile points to a different project, location, or context set ID (for example, if the file wasn't committed to Git and you reinitialize the workspace with another target). - Your account can't read the target context set, so
kcmdtreats the entry group as pending during a dry run.
If the catalog.yaml file isn't in the clone, kcmd push --dry-run fails with
a missing manifest error (Cannot find catalog manifest at 'catalog.yaml').
Verify that you have read access to the context set, and then initialize a fresh workspace before pushing:
Ask your coding agent to initialize a workspace for the same context set in an empty directory and pull the remote context set.
Copy your intended edits into that workspace and run another publish preview.
If you want to keep local-only OKF files, don't run kcmd pull --force-remove.
The --force-remove flag deletes local OKF files that aren't in
Knowledge Catalog.
For Data Agent Kit IDE extension errors and status bar warnings, see Troubleshoot.
What's next
Context sets overview
Understand context set architecture, entry categories, and how downstream AI agents consult curated context.
Manage context sets
Create, view, and delete context sets, and edit container properties in the Google Cloud console.
About enrichment tasks
Learn how cloud-managed enrichment tasks automate metadata generation and self-learning in Knowledge Studio.
Data Agent Kit overview
Explore additional coding-agent skills and MCP integrations available in Data Agent Kit.