Agent skill

identify-top-key-values

Analyze RT event tables to identify the most common values for stitching keys. Use when inspecting what ID values are actually flowing into RT 2.0, debugging unexpected stitching behavior, or checking for data quality issues like nulls or empty stitching keys.

Stars 16
Forks 23

Install this agent skill to your Project

npx add-skill https://github.com/treasure-data/td-skills/tree/main/realtime-skills/identify-top-key-values

SKILL.md

Identify Top Key Values

This skill is used to inspect the actual data flowing into RT 2.0 event tables and analyze the distribution of stitching key values. It helps debug ID stitching issues by showing the most common values for each configured stitching key, including nulls and empty values that might cause problems. This is what's seen in plazma and may not be different than what the rt system ignores by configuration.

Use this skill when you want to understand:

  • What ID values are actually present in your event data
  • Distribution patterns of stitching keys
  • Data quality issues (nulls, test values, invalid formats)

Requirements

In order to analyze key values we need:

  1. Parent segment ID - The RT-enabled parent segment to inspect
  2. Correctly configured tdx CLI or Treasure Data MCP server (@treasuredata/mcp-server)
  3. API key with database access to query the event tables
  4. Existing RT configuration with event tables and stitching keys configured

Process

This skill will:

  1. Inspect RT configuration to get event tables and stitching keys
  2. Generate dynamic query based on configured keys
  3. Analyze recent data (default: last 3 hours) for distribution patterns
  4. Show top values including nulls and potentially problematic values

Getting RT Configuration

First, inspect the current RT configuration to understand what to analyze:

bash
# Get RT configuration via CDP API
tdx api "/audiences/<parent_segment_id>/realtime_setting" --type cdp --method GET

# Example response:
# {
#   "keyColumns": [
#     { "name": "td_client_id" }
#   ],
#   "eventTables": [
#     { "database": "engage_in_app_message", "table": "be_users" }
#   ],
#   "status": "ok"
# }

Core Query Template

Based on your RT configuration, generate a query like this example for parent segment 508396:

RT Configuration:

  • eventTables: engage_in_app_message.be_users
  • keyColumns: td_client_id
sql
-- Most common values in last 3 hours (including nulls/empties)
SELECT
  key_name,
  value,
  event_count
FROM (
  SELECT 'td_client_id' as key_name, td_client_id as value, COUNT(*) as event_count
  FROM engage_in_app_message.be_users
  WHERE td_interval(time, '-3h/now')
  GROUP BY td_client_id
)
ORDER BY event_count DESC
LIMIT 100;

Related Skills

  • rt-config-id-stitching: Configure stitching keys and exclude patterns
  • rt-config-setup: View current RT configuration
  • id-graph-canonical-id-size: Analyze resulting canonical ID groups
  • id-graph-ids-to-canonical-id: Check for over-stitching issues

Expand your agent's capabilities with these related and highly-rated skills.

treasure-data/td-skills

email-campaign

This skill should be used when the user asks to "create an email", "build an email campaign", "design an email template", "generate an email for a segment", "preview an email", or "push an email to Engage". Generates enterprise-grade HTML email templates with live preview in Treasure Studio and natural language editing, then pushes the final version to Treasure Engage.

16 23
Explore
treasure-data/td-skills

action-report

YAML format reference for action reports rendered via preview_action_report. MUST be read before writing any action report YAML — defines the report structure (title, summary, actions array) and action item fields (as_is, to_be, reason, priority, category, impact) with incremental build workflow. Required by seo-analysis and any skill that produces prioritized recommendations.

16 23
Explore
treasure-data/td-skills

grid-dashboard

YAML format reference for grid dashboards rendered via preview_grid_dashboard. MUST be read before writing any dashboard YAML — defines the page structure, 6 cell types (kpi, gauge, scores, table, chart, markdown), grid layout rules, cell merging syntax, and incremental build workflow. Required by seo-analysis and any skill that produces visual data dashboards.

16 23
Explore
treasure-data/td-skills

seo-analysis

Runs SEO and AEO (Answer Engine Optimization) analysis on websites or specific pages. Use when the user mentions SEO, AEO, search rankings, search optimization, or wants to analyze how their pages perform in search engines and AI answers. Produces a data dashboard and action report with before/after recommendations.

16 23
Explore
treasure-data/td-skills

aps-doc-core

Core documentation generation patterns and framework for Treasure Data pipeline layers. Provides shared templates, quality validation, testing framework, and Confluence integration used by all layer-specific documentation skills.

16 23
Explore
treasure-data/td-skills

aps-doc-id-unification

Expert documentation generation for ID unification layers. Documents identity resolution algorithms, merge strategies, match rules, entity graphs, and multi-workflow orchestration. Use when documenting ID unification processes.

16 23
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results