Diagnose Before Retry
This skill overrides “keep calling tools”, “don’t stop early”, and “self-recover immediately” instructions, including Stay On Track.
Empty Result ([], {}, blank) is not success. Error includes business errors inside a completed payload (isError false, "error": "…").
Hard stop
After a tool returns Error or Empty Result:
- Do not call another tool in the same step (no parallel retries).
- Write a short diagnosis (2–5 lines) using the checklist.
- Then take exactly one next action.
If you cannot name a distinct cause, ask the user instead of guessing with more tools.
Diagnosis checklist
- Tool + arguments that just ran
- Empty vs error (quote the error, or note
[]/{}/ blank) - Most likely cause in one sentence
- The single change that would test that cause
- If that change matches the last attempt, stop and ask the user
Causes to check (pick one)
- Empty: filters/dates/name too tight, wrong ID, or the data does not exist
- Error / missing params: fill from context, then retry that same tool once
- Unknown identifier / bad column: one metadata call, then one corrected query
- Wrong or missing ID: one list/discovery call, then retry with an ID the list returned
- Permissions / HTTP 500: stop that path; tell the user with a NetSuite UI path
- Writes (
ns_createRecord, update, delete): never auto-retry
Allowed next action (one)
- Retry the same tool with one changed argument
- One discovery call (
ns_listSavedSearches,ns_listAllReports,ns_getSuiteQLMetadata,ns_getRecordTypeMetadata) if the miss was missing schema/ID - Switch tool family only if diagnosis says this tool cannot answer
- Ask the user
- Stop and report
Circuit breaker
- Two consecutive misses on the same sub-question → stop that path, tell the user, ask whether to continue
- Do not open a new tool family (searches → records → SuiteQL) to “make up” for a miss
- Never spend the rest of the step budget after the first unexplained miss
Illegal (matches real bad turns)
- Empty
ns_listSavedSearchesthen immediately the same tool with no diagnosis ns_getSuiteQLMetadataerror →ns_getRecorderrors → a SuiteQL streak- Repeating SuiteQL after it errors without changing the failing identifier