# KeyError binding tools with nested $defs references on OCI

## What was going on

Binding a tool whose JSON schema has nested $defs references fails with a KeyError in bind_tools. The schema dereferencing seems to lose the root $defs context when resolving inner references. I am on langchain-oci 0.2.4.

## The fix that worked

This was a real bug in the schema dereferencing used during OCI tool conversion: nested $ref pointers lost track of the root $defs dictionary and crashed with a KeyError. It was already fixed and released as langchain-oci 0.2.5, so if you are on 0.2.4 just upgrade and the nested schemas bind fine. After fixing the region, re-run the cell and the client should initialize cleanly. Source: https://github.com/oracle/langchain-oracle/issues/176

## Where this came from

https://github.com/oracle/langchain-oracle/issues/176