lu-query-use-plsql
Skill2 starsChanged 29 days agoMITView on GitHub
Use lu-query to inspect and call Oracle PL/SQL - describe_plsql for arguments and source, call_procedure for procedures/functions/package subprograms with IN/OUT/INOUT parameters and SYS_REFCURSOR results, get_plsql_errors for compile failures. Use when a business operation lives in PL/SQL rather than in a table.
In this repository45 other files it gives its agents.
- AGENTS.mdAGENTS.md
- api-and-interface-designSkill
- browser-testing-with-devtoolsSkill
- ci-cd-and-automationSkill
- code-review-and-qualitySkill
- code-reviewSkill
- code-simplificationSkill
- constraint-driven-developmentSkill
- debugging-and-error-recoverySkill
- deprecation-and-migrationSkill
- documentation-and-adrsSkill
- domain-modelingSkill
- doubt-driven-developmentSkill
- frontend-ui-engineeringSkill
- git-workflow-and-versioningSkill
- grill-meSkill
- grill-with-docsSkill
- implementSkill
- implement-specSkill
- improve-codebase-architectureSkill
- incremental-implementationSkill
- observability-and-instrumentationSkill
- performance-optimizationSkill
- planning-and-task-breakdownSkill
- prSkill
- security-and-hardeningSkill
- setup-matt-pocock-skillsSkill
- shipping-and-launchSkill
- source-driven-developmentSkill
- spec-driven-developmentSkill
- test-driven-developmentSkill
- to-specSkill
- to-ticketsSkill
- using-agent-skillsSkill
- wayfinderSkill
- writing-for-agentsSkill
- lu-query-audit-data-qualitySkill
- lu-query-audit-reportSkill
- lu-query-benchmark-sqlSkill
- lu-query-explore-schemaSkill
- lu-query-manage-schemaSkill
- lu-query-plan-data-changesSkill
- lu-query-query-dataSkill
- lu-query-triage-incidentSkill
- lu-query-tune-sqlSkill
The file
Files
Use PL/SQL with lu-query
When to use
- "Run
ADD_EMPLOYEE", "what doesGET_EMPLOYEE_COUNTreturn?", "this package body is broken."
When not to use
- Plain SQL over tables → lu-query-query-data.
- Creating packages/procedures (no tool writes PL/SQL source) → use sqlplus or a migration tool.
Workflow
- Read before calling.
describe_plsql(or resourceoracle://schema/{s}/plsql/{o}) returns the argument list withIN_OUTand direction plus the full source. Never guess an argument list. - Check it compiles.
get_plsql_errorsreturns[]when valid, or Oracle's error rows otherwise. - Build the args JSON.
argsis a JSON string: an array of{"name","direction","dataType","value"}objects in the exact parameter order.directiondefaults toIN. - Call.
call_procedure. SetisFunction: truefor functions. For functions or any cursor parameter, also setreturnType(see gotcha 2). - Read the envelope.
{outParams, returnValue, cursorResult}-outParamsholds OUT/INOUT values by name,cursorResultholds the first cursor's rows as an array. - Verify side effects.
call_procedurecommits likeexecute_dml. Re-read the affected table to prove the write.
Verified gotchas (tested 2026-10-17 on 26ai Free)
- DATE and TIMESTAMP parameters: pass the value as a string in the session's
NLS_DATE_FORMAT, not asdataType: "DATE"/"TIMESTAMP". An ISO value (2026-02-01) withdataType: "DATE"fails withORA-01861: literal does not match format string; so doesdataType: "TIMESTAMP"andTO_DATE('...')inside the value. What works:{"dataType":"VARCHAR2","value":"01-FEB-2026"}- i.e.DD-MON-RR. Check the session format first withrun_queryonNLS_SESSION_PARAMETERS. - REF CURSOR results need
returnType. For a function returning a cursor, passreturnType: "REF CURSOR". Without it Oracle answersPLS-00382: expression is of wrong type. The rows then appear incursorResult. BOOLEAN,RECORD,TABLE,VARRAYandOBJECTarguments are rejected with guidance: create a scalar wrapper subprogram. This is a hard boundary, not a retryable error.get_plsql_errorson a valid object returns[].
Tool reference
| Tool | Signature | Returns |
describe_plsql | name*, type?, schema? | {schema, name, type, arguments: [{ARGUMENT_NAME, DATA_TYPE, IN_OUT, POSITION, DEFAULTED}], source} |
call_procedure | name*, args* (JSON string), isFunction?, returnType?, schema? | {outParams, returnValue, cursorResult} |
get_plsql_errors | name?, type?, schema? | array of Oracle error rows (empty when valid) |
Details: references/tools.md. Verified transcripts: references/examples.md.
Safety
call_procedurecommits. It is the write path for business logic; get approval before calling anything that mutates.EXECUTEgrants are the barrier - if Oracle refuses, the fix is a grant, not a workaround.
Failure recovery
| Symptom | Cause | Action |
ORA-01861 | ISO string bound to a DATE parameter | re-send as VARCHAR2 in NLS_DATE_FORMAT |
PLS-00382 | cursor function without returnType | add returnType: "REF CURSOR" |
ORA-06550 other | signature mismatch | re-run describe_plsql; match names/order |
is not bindable via JDBC | non-scalar type | write a scalar wrapper (PL/SQL side) |
ORA-01031 | no GRANT EXECUTE | request the grant |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

