Expand description
Structured, agent-facing error envelope for the oraclemcp Oracle MCP
server (plan §8.2, bead P0-1).
The contract: agent-facing failures are returned as an MCP tool result
with isError: true and an actionable ErrorEnvelope — never as an
opaque JSON-RPC numeric error code. Every envelope names a machine-stable
ErrorClass, a human/LLM-readable message, and a concrete next step
(suggested_tool, fuzzy_matches, or next_steps). For example, an
Oracle ORA-00942 becomes
{ "isError": true, "error_class": "OBJECT_NOT_FOUND", "suggested_tool": "oracle_schema_inspect", "fuzzy_matches": [...] }.
This crate is a leaf of the oraclemcp-* core (it imports no other
workspace crate) so every layer can produce the same envelope shape
without a dependency cycle.
Re-exports§
pub use fuzzy::enrich_oracle_error;pub use fuzzy::fuzzy_suggest;pub use fuzzy::levenshtein;
Modules§
- fuzzy
- Actionable-error enrichment + fuzzy schema suggestions (plan §8.2; bead
P1-ERR). Additive over the P0-1
ErrorEnvelope: maps a rawORA-error plus the agent’s referenced object name and the cached schema object list to a structured envelope withsuggested_tool, near-missfuzzy_matches, and a concrete next step. Pure (the candidate list is passed in) — no DB / engine dependency.
Structs§
- Error
Envelope - The actionable, agent-facing error payload (plan §8.2).
Enums§
- Error
Class - Machine-stable classification of an agent-facing error.
- Oracle
McpError - Library-side error type for
?-propagation across theoraclemcpcore.
Functions§
- classify_
ora_ code - Map a numeric Oracle error code to its
ErrorClass. - envelope_
from_ oracle_ message - Build an agent-facing envelope from a raw Oracle error message, classifying
the
ORA-code and seeding the default suggested tool. - parse_
ora_ code - Parse the leading
ORA-NNNNNcode from an Oracle error message, if present.
Type Aliases§
- Result
- Convenience alias for fallible
oraclemcpcore operations.