Built-in Prompts
Built-in prompts
In addition to the 30 tools, the Single Origin MCP server ships with five pre-written prompts. They're invoked from your client's prompt palette (in Claude Code, as /singleorigin:<prompt-name>) and orchestrate the right sequence of tool calls for the most common workflows — so your agent doesn't have to figure them out from scratch.
list_recommendations
list_recommendationsSurveys the workspace's current optimization opportunities and prints them, sorted by estimated daily savings, in a consistent block format with full IDs and query signatures — then offers to page further or review a specific one.
When to use: a weekly optimization review, a kickoff "what should we work on this sprint?" conversation, or anyone asking "where are we wasting compute?"
Sample invocation
/singleorigin:list_recommendations
What the agent does
- Calls
list_recommendations(page 0). - Renders each recommendation as a block — ID, title, type, status, processing time, estimated daily savings, and query signatures.
- Offers two next steps: view the next page, or review one with
/singleorigin:review_recommendation {ID}.
review_recommendation
review_recommendationWalks through a single recommendation end-to-end: its details, the SQL change it implies, the top target queries by cost, and a confidence assessment of whether the recommendation actually applies.
When to use: before acting on a recommendation — get a structured second opinion that pulls together the underlying queries and DDL.
Sample invocation
/singleorigin:review_recommendation 9c2b1f7e-4a3d-4e10-9f02-1ab2c3d4e5f6
What the agent does
- Calls
get_recommendationfor the full payload andget_recommendation_itemsfor per-query impact (already sorted by cost). - Displays the recommendation — background, target inefficiency, proposed change, and the top items by cost.
- Uses
query_detailon the top example queries to check whether the described inefficiency actually appears in them and flags possible false positives. - Closes with a High / Medium / Low confidence rating, reasoning, and caveats.
similar_query_search
similar_query_searchStarts from a single query and finds historical queries with similar operator-tree fragments — so you can tell whether a slow query is a one-off or part of a recurring pattern worth fixing once.
When to use: an engineer flags one slow query and you want to know how widespread its shape is.
Sample invocation
/singleorigin:similar_query_search 01HXY8F3A4B5C6D7E8F9
What the agent does
- Calls
query_detailandquery_fragments_for_queryfor the anchor query, and maps each fragment's operator tree back to the SQL region it came from. - Passes each fragment's operator-tree text to
search_similar_queries, then dedupes by signature and keeps the top 10 by similarity score. - Calls
query_detailon each candidate to locate the matching SQL region. - Presents results grouped by input SQL region, listing each match's query_id, signature, processing time, and similarity score.
table_scan_analysis
table_scan_analysisAnalyzes a table's scan-cost profile over a date range, detects table→view migrations, and summarizes scan cost and pruning efficiency per query signature.
When to use: "why did scan cost on this table change?", investigating a clustering/migration's effect, or a routine scan-cost health check on a hot table.
Sample invocation
/singleorigin:table_scan_analysis analytics_db.analytics.orders_fact
Optional start_date / end_date arguments narrow the window (it defaults to the last two weeks).
What the agent does
- Calls
resolve_table_referenceto determine whether the FQN is a base table or a view (and, for a view, its physical sources and structure). - Calls
table_scan_costfor the table (and each physical source), using one broad date range. - Detects a table→view migration when a now-view FQN still has historical scan cost, and reports the approximate migration date.
- Renders a pivot table (
$scan_cost / pruning% / exec_countper cell) for the top signature + filter-column groups, a per-table breakdown, and each physical table's row count, size, and cluster key.
parse_dag_task_from_signature
parse_dag_task_from_signatureExplains how to pull the dag_id and task_id out of a query_signature so queries can be grouped or filtered by their originating Airflow DAG/task.
When to use: the user wants to view, filter, or group queries by DAG or task — e.g. a slow query whose owner is a service account and you need the DAG/task behind it.
Sample invocation
/singleorigin:parse_dag_task_from_signature
What the agent does
Applies the signature format directly — a query_signature is one of "<dag_id> &&& <task_id>||<rel_hash>", "<dag_id> &&& <task_id>", or "<rel_hash>". Whenever &&& is present, the dag_id and task_id are the parts before and after it.