What is a schema?
A schema is a typed data model that represents the result of a tool call. Schemas describe what fields exist, which fields are optional, how values are formatted and what data is considered canonical (universal to those belonging to the domain). In OpenTools, schemas are defined using strongly typed models and validated at runtime. If a provider returns malformed or unexpected data, it fails early instead of silently leaking into your agent logic.Why schemas exist
Providers rarely agree on how data should look. For example, some “accounts” across trading providers might use different field names or represent numbers as strings/floats. Others include inconsistent timestamps for different timezones or return extra metadata that is found nowhere else. Schemas exist to solve this by enforcing a canonical shape.Your agent logic cares about how that structure should look and it should not break so that you can incorporate many different providers in a plug and play fashion depending on user needs. So, put simply, anAccount should look like an Account.
A quick example: Account
Every schema in OpenTools is built around a clear separation between canonical fields and provider fields. Data from APIs, as mentioned, is almost always expressed differently meaning it might not be as simple as fitting into a defined schema. Our canonical fields define the contract your application relies on. These provider_fields preserve raw metadata without polluting that contract that you may need.
Here is a view of the schema: