Skill v1.0.1
currentAutomated scan100/100+2 new
version: "1.0.1"
name: request-routing description: > Route SAS Viya requests for finding resources,reading tables, running queries, scoring MAS/job/jobdef/SCR/cas models, listing resources, and describing metadata. Use when the task involves choosing the correct SAS Viya tool or deciding whether to verify, read, query, score, list, or describe a resource.
Request Routing — Canonical SKILL
Purpose: single source-of-truth for routing SAS Viya actions (read, query, score, describe, list).
Dotted Resource Reference Parsing — a.b Notation
When any resource reference appears in the form a.b, parse b to determine the resource type:
b value | Resource type | Parsed as | |
|---|---|---|---|
mas | MAS model | name = a | |
job | Job model | name = a | |
jobdef | JobDef model | name = a | |
scr | SCR model | name = a | |
cas | CAS model in a cas table | name = a | |
| anything else | Table | lib = a, table = b |
Rule: if b is not one of {mas, job, jobdef, scr, sas, casl}, treat a.b as a table reference where a is the library name and b is the table name.
Examples:
Public.customers→ table, lib=Public, table=customersSASHELP.cars→ table, lib=SASHELP, table=carschurnRisk.mas→ MAS model, name=churnRisksimplejob.job→ Job model, name=simplejobmyScorer.jobdef→ JobDef model, name=myScorerloanModel.scr→ SCR model, name=loanModel
Quick workflow
- Verify — confirm resources exist (use find-*).
- Execute — run the mapped execution tool (read, query, score, describe, list).
- Format — return results and append a short Strategy Summary.
Important Reminder: If the category is "Find resource" do not use the list- rules below, use the specific find- tool for that resource type. The list-* tools are for discovery when the user does not have a specific resource in mind.
Classification
| Category | Triggers | Primary Action | Primary Tool(s) | |
|---|---|---|---|---|
| Find resource | "find", "does X exist", "locate", "verify" | Verify resource | sas-score-find-library, sas-score-find-table, sas-score-find-mas, sas-score-find-job, sas-score-find-jobdef | |
| Read / Query | "read", "show rows", "how many", "count", "average", "query" | Read / aggregate | sas-score-read-table, sas-score-sas-query | |
| Score | "score", "predict", "run model" | Score inputs | sas-score-mas-score, sas-score-scr-score, sas-score-job-score, sas-score-jobdef-score, sas-score-program-score, sas-score-cas-program-score | |
| List / Discover | "list", "show all", "browse" | List resources | Use list-library skill for libraries, list-tables skill for tables in a library, list-mas-job-jobdef skill for models/jobs/jobdefs | |
| Describe | "describe", "what inputs", "metadata" | Return metadata | sas-score-*-describe (mas/job/jobdef/scr/table) |
Verification rules
- Always verify resources using the appropriate
find-*tool before executing actions
Execution rules
- Execute only after verification; choose the execution tool per the Execute mapping section.
- Scoring flows:
- Inline scenario: verify model → call scoring tool.
- Table rows: verify model + table → read rows → map columns to model inputs → score → merge predictions with rows.
- Read/query flows:
- Use
sas-score-read-tablefor all row reads, including those with a WHERE filter. A filter condition is not a reason to use sas-query. - Use
sas-score-sas-queryonly when the request requires SQL aggregation (COUNT, SUM, AVG, MIN, MAX), GROUP BY, JOIN across tables, or computed columns. - When mapping between table columns and model inputs is ambiguous, ask the user for explicit mapping.
Defaults & exceptions
- Default model type: MAS unless the user specifies otherwise.
- Skip
find-*verification for SCR models; SCR endpoints may be scored directly. - If server determination is ambiguous, prompt the user for clarification.
- Pagination: always pass
start=1andlimit=10when calling any tool that accepts these parameters, unless the user specifies different values. Never omit them and rely on tool-level defaults.
Execute mapping (concise)
- Read rows (including WHERE filter):
sas-score-read-table(lib, table, server, where) - SQL aggregation/join only:
sas-score-sas-query(lib.table, query, sql) - MAS scoring:
sas-score-mas-score(mas, scenario) - Job scoring:
sas-score-job-score(name, scenario) - JobDef scoring:
sas-score-jobdef-score(name, scenario) - SCR scoring:
sas-score-scr-score(name, scenario) - Program scoring:
sas-score-program-score(src, scenario, folder, output, limit) - CAS Program scoring:
sas-score-cas-program-score(src, scenario, folder, output, limit) - Describe:
sas-score-*-describe(mas/job/jobdef/scr/table)
Combined Read + Score (short)
- Verify: find table (server) and find the model (mas,job,jobdef,scr). If table/model not found, ask user to clarify resource and server.
- Read: fetch rows (read-table or sas-query).
- Map: ensure table columns match model inputs; ask for mapping if needed.
- Score: call the appropriate scoring tool.
- Merge: attach predictions to rows and return.
Strategy Summary (append to responses)
Strategy Summary:
- Classification: [Find / Read / Score / List / Describe]
- Verification: [Resources verified / skipped]
- Tool(s): [Primary tool(s) invoked]
- Decision: [Server chosen, model type, mapping]
- Next steps: [Follow-ups or clarifications]
Error handling (short)
- Resource not found → ask for exact resource name and server (for tables).
- Column/input mismatch → request mapping from user.
- Empty result → ask to relax filters or confirm criteria.
- Execution error → return tool error verbatim.
Examples (minimal)
- Read: "read customers in Public" → find Public (CAS) → read-table → return rows.
- Score inline: "score a=1,b=2 with job simplejob" → find job → job-score → return merged result.
- Score table: "score Public.customers with model risk" → find table (CAS) & model (MAS) → read rows → score → return merged.
Notes: Keep this SKILL as the canonical, compact router; agent wrappers should be short and reference this document for details and examples.