Skip to main content

Tools

Tools are the primary way AI assistants interact with your DynamoDB data. Each tool is only available when the bearer token includes the required scope.

list_tables

Lists tables available in one schema for the authenticated tenant. Required scope: schemas:read Arguments:
NameTypeRequiredDescription
schema_namestringNoSchema to list. Defaults to the tenant’s default schema.
refreshstringNoMetadata refresh mode: if_stale (default), force, or skip.
Response fields:
FieldDescription
schema_nameResolved schema name
tablesArray of table objects with name, qualified_name, physical_table_name, item_count, and refreshed_at
truncatedtrue when more than 200 tables exist (results capped at 200)
refreshedWhether metadata was refreshed on this call
refreshed_atISO timestamp of the last metadata refresh
stale_after_secondsSeconds until metadata is considered stale
Example interaction:
User: “What tables do I have?” Assistant calls: list_tables with {} Result: 3 tables — orders, customers, products in schema east

describe_table

Returns column, index, and type metadata for a single table. Required scope: schemas:read Arguments:
NameTypeRequiredDescription
table_namestringYesTable name to describe.
schema_namestringNoSchema containing the table. Defaults to the tenant’s default schema.
refreshstringNoMetadata refresh mode: if_stale (default), force, or skip.
Response fields:
FieldDescription
schema_nameResolved schema name
table_nameResolved table name
qualified_nameschema_name.table_name
physical_table_namePhysical DynamoDB table name used for execution
item_countApproximate row count
refreshedWhether metadata was refreshed on this call
refreshed_atISO timestamp of the last metadata refresh for this table
stale_after_secondsSeconds until metadata is considered stale
columnsArray of column objects with name, type, and nullable
indexesArray of index objects with name, type, hashKey, hashKeyType, and optional sortKey/sortKeyType
attribute_typesDynamoDB attribute type mappings
Example interaction:
User: “What columns does the orders table have?” Assistant calls: describe_table with { "table_name": "orders" } Result: Columns order_id (S, primary key), customer_id (S), total (N), status (S), order_date (S)

run_sql

Executes a read-only SQL query against the authenticated tenant’s data. Required scope: query Arguments:
NameTypeRequiredDescription
sqlstringYesSQL query to execute. Must begin with SELECT or WITH.
max_rowsintegerNoMaximum rows to return (1—1000, default 100).
Response fields:
FieldDescription
columnsArray of column names
rowsArray of row objects
firstRowIdxIndex of the first row in the result set
resumeIdxNext row index for pagination (absent when exhausted)
planTimeParse and plan time in milliseconds
execTimeTotal execution time in milliseconds
Error cases:
ConditionBehavior
SQL does not start with SELECT or WITHReturns tool error: “Only read-only SELECT statements are supported”
SQL syntax errorReturns tool error with parse error details
Table not foundReturns tool error with table resolution failure
Example interaction:
User: “Show me the top 5 customers by total spend” Assistant calls: run_sql with:
{
  "sql": "SELECT customer_id, SUM(total) AS total_spend FROM east.orders GROUP BY customer_id ORDER BY total_spend DESC LIMIT 5",
  "max_rows": 5
}
Result: 5 rows with customer_id and total_spend columns

Resources

Resources provide static documentation that AI assistants can read for context about DynamoSQL’s SQL capabilities.

docs://sql-overview

High-level summary of supported SQL features including SELECT, JOINs, CTEs, aggregations, subqueries, set operations, and functions. Includes an example query.

docs://sql-limitations

List of unsupported features including write operations, DDL, window functions, recursive CTEs, CAST/CONVERT, and behavioral notes about pagination and string escaping.
AI assistants can read these resources to understand what SQL syntax is available before writing queries, reducing errors from unsupported features.

Prompts

Prompts are guided workflows that help AI assistants follow best practices when exploring data or writing queries.

explore-data

Guides the AI through schema discovery before querying. Arguments:
NameTypeRequiredDescription
goalstringNoWhat the user wants to explore or learn about the data.
schema_namestringNoPreferred schema to start with.
Behavior: Instructs the AI to call list_tables first, then describe_table on relevant tables, and keep queries bounded with LIMIT.

write-query

Helps the AI write a read-only query that respects DynamoSQL limitations. Arguments:
NameTypeRequiredDescription
requeststringYesNatural language description of the desired query.
schema_namestringNoSchema to target.
table_namestringNoPreferred table.
Behavior: Instructs the AI to use only SELECT syntax, avoid unsupported features (INSERT, UPDATE, DELETE, DDL, window functions, CAST), and reference the SQL limitations documentation when needed.

Metadata refresh modes

The refresh parameter on list_tables and describe_table controls how table metadata is loaded:
ModeBehavior
if_staleRefreshes metadata only if older than the configured staleness threshold (default)
forceAlways refreshes metadata from DynamoDB, even if recently cached
skipUses cached metadata without checking freshness
Use force when you know table structure has recently changed. Use skip to avoid refresh latency when metadata accuracy is not critical.