Skip to main content

Crate oraclemcp_error

Crate oraclemcp_error 

Source
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 ErrorEnvelopenever 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 raw ORA- error plus the agent’s referenced object name and the cached schema object list to a structured envelope with suggested_tool, near-miss fuzzy_matches, and a concrete next step. Pure (the candidate list is passed in) — no DB / engine dependency.

Structs§

ErrorEnvelope
The actionable, agent-facing error payload (plan §8.2).

Enums§

ErrorClass
Machine-stable classification of an agent-facing error.
OracleMcpError
Library-side error type for ?-propagation across the oraclemcp core.

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-NNNNN code from an Oracle error message, if present.

Type Aliases§

Result
Convenience alias for fallible oraclemcp core operations.