Source: factory.ai/package.mcp/ObjAiMcpDatabase.py
Database schema and calculation-SQL context provider for the AI layer.
Fetches CREATE TABLE DDL and SQL strings from def_calculations so they
can be embedded in AI prompts as grounding context. This is a
data-context provider — it does not route prompts to an LLM.
...
| Method | Signature | Description |
|---|---|---|
| get_schema | get_schema(table_names: list) -> str |
Return CREATE TABLE DDL for each listed table. |
| get_sql_samples | get_sql_samples(package: str, group_name: str = '', limit: int = 30) -> list |
Fetch SQL strings from def_calculations for the given package. |
| get_group_names | get_group_names(package: str, limit: int = 200) -> list[str] |
Fetch distinct CalculationGroup names for the given package. |
| get_execution_samples | get_execution_samples(package: str, calc_names: list, limit: int = 50) -> dict |
Fetch recent execution records from track_calculations. |
| prompt | prompt(role: str = '', prompt: str = '', image_base64: str = '') -> str |
Not applicable — this is a data-context provider, not an LLM. |
| embed | embed(text: str = '') -> list |
Not applicable — this is a data-context provider, not an LLM. |