client.agent.schema
Get the agent's view of your database schema — the tables and columns available for natural-language querying.
Signature
class Client {
agent: {
schema(): Promise<{ tables: Array<{ name: string; columns: Array<{ name: string; type: string }> }> }>
}
}
Examples
const { tables } = await bf.agent.schema()
for (const t of tables) {
console.log(`${t.name}: ${t.columns.map(c => `${c.name} (${c.type})`).join(', ')}`)
}
Throws
| Error | Condition |
|---|---|
| API request failed |
| Network issue |
Pitfalls
- Cached schema — the agent caches schema for 60 seconds. Newly added tables may not appear immediately.
See also
{auto-injected}
Tested against
{auto-injected}