Tables and columns

Which tables the agent may query, and the descriptions it reads them by.

Base URL https://futuresmart.ai/database-agent/api · every request sends X-API-Key. Samples read the key from DATABASE_AGENT_API_KEY. All endpoints

Db List Tables

GET/v1/agents/{agent_id}/databases/{db_id}/tables

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstring
db_idrequiredstring

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.get(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/databases/YOUR_DB_ID/tables",
    headers={"X-API-Key": API_KEY},
    timeout=120,
)
r.raise_for_status()
print(r.json())

Db Create Tables

POST/v1/agents/{agent_id}/databases/{db_id}/tables

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstring
db_idrequiredstring

Request body · multipart/form-data (optional)

NameTypeDescription
filestring | null
table_descriptionsstring | null

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.post(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/databases/YOUR_DB_ID/tables",
    headers={"X-API-Key": API_KEY},
    data={"file": "<file>", "table_descriptions": "<table_descriptions>"},
    timeout=120,
)
r.raise_for_status()
print(r.json())

Db Put Tables

PUT/v1/agents/{agent_id}/databases/{db_id}/tables

Bulk update table descriptions for a db_id — merges into the existing set (does not blank tables absent from the payload). Accepts a bare [{table_name, description}] array, a {"tables": [...]} object, or a file. Returns an "updated" message.

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstring
db_idrequiredstring

Request body · multipart/form-data (optional)

NameTypeDescription
filestring | null
table_descriptionsstring | null

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.put(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/databases/YOUR_DB_ID/tables",
    headers={"X-API-Key": API_KEY},
    data={"file": "<file>", "table_descriptions": "<table_descriptions>"},
    timeout=120,
)
r.raise_for_status()
print(r.json())

Db Delete Tables

DELETE/v1/agents/{agent_id}/databases/{db_id}/tables

Clear table descriptions. Body: {"table_names": ["t1","t2"]} for some, or {"delete_all": true} for all. (Tables are not deleted — only their description text is cleared.)

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstring
db_idrequiredstring

Request body · application/json

NameTypeDescription
table_namesarray<string> | nullTable names to clear
delete_allbooleanClear ALL table descriptions for this databaseDefault: false

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.delete(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/databases/YOUR_DB_ID/tables",
    headers={"X-API-Key": API_KEY},
    json={
        "delete_all": False,
    },
    timeout=120,
)
r.raise_for_status()
print(r.json())

Example request body

JSON
{
  "delete_all": false
}

Db Generate Table Descriptions

POST/v1/agents/{agent_id}/databases/{db_id}/tables/generate

Start an async job that auto-generates a description for every table in the DB (via LLM). overwrite=true regenerates all tables; default only fills tables whose description is currently blank (manually-set ones are preserved). Poll the returned job_id.

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstring
db_idrequiredstring

Query parameters

NameTypeDescription
overwritebooleantrue = regenerate ALL tables; false (default) = only fill tables whose description is blank (manual ones preserved)Default: false

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.post(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/databases/YOUR_DB_ID/tables/generate",
    headers={"X-API-Key": API_KEY},
    timeout=120,
)
r.raise_for_status()
print(r.json())

Db Poll Table Descriptions

GET/v1/agents/{agent_id}/databases/{db_id}/tables/generate/{job_id}

Poll a table-description generation job → {status, message, error}.

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstring
db_idrequiredstring
job_idrequiredstring

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.get(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/databases/YOUR_DB_ID/tables/generate/YOUR_JOB_ID",
    headers={"X-API-Key": API_KEY},
    timeout=120,
)
r.raise_for_status()
print(r.json())

Db Generate One Table Description

POST/v1/agents/{agent_id}/databases/{db_id}/tables/{table_name}/generate

Auto-generate (LLM) + save the description for a SINGLE table. Synchronous — returns {table_name, description} directly (no job/poll). Other tables and flags are untouched.

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstring
db_idrequiredstring
table_namerequiredstring

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.post(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/databases/YOUR_DB_ID/tables/YOUR_TABLE_NAME/generate",
    headers={"X-API-Key": API_KEY},
    timeout=120,
)
r.raise_for_status()
print(r.json())

Db Table Visibility

PATCH/v1/agents/{agent_id}/databases/{db_id}/tables/{table_name}/visibility

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstring
db_idrequiredstring
table_namerequiredstring

Request body · application/json (optional)

NameTypeDescription
is_includedrequiredbooleanWhether table is included

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.patch(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/databases/YOUR_DB_ID/tables/YOUR_TABLE_NAME/visibility",
    headers={"X-API-Key": API_KEY},
    json={
        "is_included": False,
    },
    timeout=120,
)
r.raise_for_status()
print(r.json())

Example request body

JSON
{
  "is_included": false
}

Db Update Table Description

PUT/v1/agents/{agent_id}/databases/{db_id}/tables/{table_name}

Update the description for a single table in the given db_id.

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstring
db_idrequiredstring
table_namerequiredstring

Request body · application/json (optional)

NameTypeDescription
descriptionrequiredstringTable description
is_includedboolean | nullWhether table is included (optional)

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.put(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/databases/YOUR_DB_ID/tables/YOUR_TABLE_NAME",
    headers={"X-API-Key": API_KEY},
    json={
        "description": "<description>",
    },
    timeout=120,
)
r.raise_for_status()
print(r.json())

Example request body

JSON
{
  "description": "<description>"
}

Db Get Columns

GET/v1/agents/{agent_id}/databases/{db_id}/tables/{table_name}/columns

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstring
db_idrequiredstring
table_namerequiredstring

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.get(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/databases/YOUR_DB_ID/tables/YOUR_TABLE_NAME/columns",
    headers={"X-API-Key": API_KEY},
    timeout=120,
)
r.raise_for_status()
print(r.json())

Db Update Columns

PUT/v1/agents/{agent_id}/databases/{db_id}/tables/{table_name}/columns

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstring
db_idrequiredstring
table_namerequiredstring

Request body · application/json (optional)

NameTypeDescription
user_idstring | nullUser ID (optional if using auth token)
columnsrequiredarray<ColumnDescriptionUpdate>List of column descriptions
↳ column_namerequiredstringName of the column
↳ descriptionrequiredstringDescription of the column

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.put(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/databases/YOUR_DB_ID/tables/YOUR_TABLE_NAME/columns",
    headers={"X-API-Key": API_KEY},
    json={
        "columns": [{
            "column_name": "<column_name>",
            "description": "<description>",
        }],
    },
    timeout=120,
)
r.raise_for_status()
print(r.json())

Example request body

JSON
{
  "columns": [
    {
      "column_name": "<column_name>",
      "description": "<description>"
    }
  ]
}