Astra DB

v2.0.0
io.github.erichare/astra-mcp Checked 2 days ago Published 2 months ago

Astra DB tools for agents: schema, find, vector search, guarded writes, and interactive views.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

connection_status Astra DB connection status

Check whether Astra DB credentials are configured and working: where the token, endpoint, and keyspace come from (env, .env, plugin settings, Astra CLI), which database is targeted, and a live connectivity check. Call it first when another tool reports not_configured or an auth error.

ParameterTypeDescription
checkbooleanMake a live request to verify the connection (default true).

list_databases List Astra databases

List the Astra databases this token can access (DevOps API): name, id, status, regions with Data API endpoints, and keyspaces. Use it to choose the `database` argument of other tools.

ParameterTypeDescription
includestringactive (default) or all non-terminated databases.

database_overview Astra DB overview

Map a database: keyspaces → collections (vector dimension/metric, vectorize model, lexical/rerank, estimated counts) and tables (column and vector-column counts). Start here to see what exists. Renders an interactive overview.

ParameterTypeDescription
databasestringDatabase to use: name, id, or Data API endpoint URL. Omit for the configured default.
emitstringhtml_file also writes a self-contained HTML page and returns a link to it — only for terminal-only hosts, when the user asks for a visual.
includeCountsbooleanEstimated document counts per collection (one request each).
keyspacesarrayOnly these keyspaces (default: all).
maxPerKeyspaceintegerMax collections/tables listed per keyspace.

describe_collection Describe collection

Show one collection's configuration and shape: vector settings, vectorize and rerank services, lexical, indexing allow/deny, default id type, estimated count, and a sample document with field types. Use before writing queries or code against it.

ParameterTypeDescription
collection *stringCollection name.
databasestringDatabase to use: name, id, or Data API endpoint URL. Omit for the configured default.
emitstringhtml_file also writes a self-contained HTML page and returns a link to it — only for terminal-only hosts, when the user asks for a visual.
includeSamplebooleanInclude one sample document (vectors omitted).
keyspacestringKeyspace. Omit for the configured/default keyspace.

describe_table Describe table

Show one table's schema: columns and types, primary key (partition and clustering columns), indexes, vector columns, and sample rows. Use before writing queries or code against it.

ParameterTypeDescription
table *stringTable name.
databasestringDatabase to use: name, id, or Data API endpoint URL. Omit for the configured default.
emitstringhtml_file also writes a self-contained HTML page and returns a link to it — only for terminal-only hosts, when the user asks for a visual.
includeSamplebooleanInclude up to 3 sample rows (vectors omitted).
keyspacestringKeyspace. Omit for the configured/default keyspace.

find Find documents or rows

Read documents (collections) or rows (tables) with an optional Data API filter, sort, and projection. Returns pages of 20 plus nextPageState for more. For similarity search use vector_search. Renders an interactive explorer.

ParameterTypeDescription
name *stringCollection or table name.
databasestringDatabase to use: name, id, or Data API endpoint URL. Omit for the configured default.
emitstringhtml_file also writes a self-contained HTML page and returns a link to it — only for terminal-only hosts, when the user asks for a visual.
filterobjectData API filter, e.g. {"status": "active", "year": {"$gte": 2020}}. Typed ids as {"$uuid": "…"} / {"$objectId": "…"}.
keyspacestringKeyspace. Omit for the configured/default keyspace.
kindstringOnly needed when a collection and a table share the name; otherwise detected.
limitintegerDocuments to return (rounded up to whole pages of 20).
pageStatestringnextPageState from a previous call, to continue paging.
projectionobjectFields to include (1) or exclude (0), e.g. {"title": 1, "author": 1}.
sortobjectNon-vector sort, e.g. {"createdAt": -1}. For similarity use vector_search.

count Count documents

Exact count of documents in a collection matching a filter, up to upperBound (Data API maximum 1000); unfiltered counts also report the estimated total.

ParameterTypeDescription
name *stringCollection name.
databasestringDatabase to use: name, id, or Data API endpoint URL. Omit for the configured default.
filterobjectData API filter, e.g. {"status": "active", "year": {"$gte": 2020}}. Typed ids as {"$uuid": "…"} / {"$objectId": "…"}.
keyspacestringKeyspace. Omit for the configured/default keyspace.
upperBoundintegerStop counting at this many (Data API maximum 1000).

distinct_values Distinct values

Distinct values of a field (dot paths allowed) across up to scanLimit documents or rows, optionally filtered — useful for discovering categories before filtering.

ParameterTypeDescription
field *stringField path, e.g. "genre" or "author.country".
name *stringCollection or table name.
databasestringDatabase to use: name, id, or Data API endpoint URL. Omit for the configured default.
filterobjectData API filter, e.g. {"status": "active", "year": {"$gte": 2020}}. Typed ids as {"$uuid": "…"} / {"$objectId": "…"}.
keyspacestringKeyspace. Omit for the configured/default keyspace.
kindstringOnly needed when a collection and a table share the name; otherwise detected.
maxValuesintegerMax distinct values returned.
scanLimitintegerMax documents scanned.

list_vectorize_providers Vectorize providers

List the embedding (vectorize) and reranking providers and models available to the database, with dimensions and authentication options. Use before create_collection with a vectorize service.

ParameterTypeDescription
databasestringDatabase to use: name, id, or Data API endpoint URL. Omit for the configured default.
kindstring

code_examples Data API code examples

Canonical Data API client code for Python (astrapy), TypeScript (@datastax/astra-db-ts), Java, C#, and Go from the bundled, documentation-derived example library. Use when writing application code; snippets read ASTRA_DB_APPLICATION_TOKEN / ASTRA_DB_API_ENDPOINT from the environment.

ParameterTypeDescription
language *stringClient language.
query *stringWhat the code should do, e.g. "create a vector collection with vectorize", "find with filter and sort".
limitinteger
modestringcontent: include source; list: file names only.

insert Insert documents or rows

Insert 1–1000 documents into a collection (or rows into a table), in chunks. On vectorize collections use "$vectorize": "text" to embed server-side; otherwise "$vector": [...] for your own embeddings. Reports inserted ids and any per-document errors.

ParameterTypeDescription
documents *arrayDocuments (collections) or rows (tables). Use "$vectorize": "text" for server-side embeddings on vectorize collections.
name *stringCollection or table name.
databasestringDatabase to use: name, id, or Data API endpoint URL. Omit for the configured default.
keyspacestringKeyspace. Omit for the configured/default keyspace.
kindstringOnly needed when a collection and a table share the name; otherwise detected.
orderedbooleanStop at the first error (default: insert what can be inserted).

update Update documents or rows

Update the document/row matching a filter with operators ($set, $unset, $inc, $push, …). `many` updates every match (collections only); `many` or an empty filter requires the user's confirmation. `upsert` inserts when nothing matches.

ParameterTypeDescription
filter *objectData API filter, e.g. {"status": "active", "year": {"$gte": 2020}}. Typed ids as {"$uuid": "…"} / {"$objectId": "…"}.
name *stringCollection or table name.
update *objectUpdate operators, e.g. {"$set": {"status": "done"}, "$inc": {"views": 1}}.
confirmstringSet ONLY after you described the impact and the user approved it in a later message: the exact target name. The original request is not approval; never guess or self-approve.
databasestringDatabase to use: name, id, or Data API endpoint URL. Omit for the configured default.
keyspacestringKeyspace. Omit for the configured/default keyspace.
kindstringOnly needed when a collection and a table share the name; otherwise detected.
manybooleanUpdate every match (collections only). Requires confirmation.
upsertbooleanInsert when nothing matches (collections).

delete Delete documents or rows

Delete the document/row matching a filter. `many` deletes every match; `many` or an empty filter requires the user's confirmation.

ParameterTypeDescription
filter *objectData API filter, e.g. {"status": "active", "year": {"$gte": 2020}}. Typed ids as {"$uuid": "…"} / {"$objectId": "…"}.
name *stringCollection or table name.
confirmstringSet ONLY after you described the impact and the user approved it in a later message: the exact target name. The original request is not approval; never guess or self-approve.
databasestringDatabase to use: name, id, or Data API endpoint URL. Omit for the configured default.
keyspacestringKeyspace. Omit for the configured/default keyspace.
kindstringOnly needed when a collection and a table share the name; otherwise detected.
manybooleanDelete every match. Requires confirmation.

create_collection Create collection

Create a collection: plain JSON, vector (dimension + metric), or vectorize (server-side embeddings from a provider — see list_vectorize_providers), optionally with lexical (BM25) and rerank for hybrid search, indexing allow/deny, and a default id type. Idempotent when the settings match an existing collection.

ParameterTypeDescription
name *stringNew collection name (letters, digits, underscore).
databasestringDatabase to use: name, id, or Data API endpoint URL. Omit for the configured default.
defaultIdstringAuto-generated _id type.
indexingobjectIndex only (allow) or all but (deny) these fields. Deny large text fields you never filter on.
keyspacestringKeyspace. Omit for the configured/default keyspace.
lexicalbooleanEnable BM25 lexical search (needed for hybrid).
rerankobjectReranking service (needed for hybrid).
vectorobjectOmit for a non-vector collection.

create_table Create table

Create a table with typed columns (text, int, uuid, timestamp, map/list/set, vector…) and a primary key (partition columns plus optional clustering order). Then add indexes with create_index for columns you filter or vector-search on.

ParameterTypeDescription
columns *objectColumn types, e.g. {"id": "uuid", "title": "text", "tags": {"type": "set", "valueType": "text"}, "embedding": {"type": "vector", "dimension": 1024}}.
name *stringNew table name.
primaryKey *A column name, or {"partitionBy": ["user_id"], "partitionSort": {"created_at": -1}}.
databasestringDatabase to use: name, id, or Data API endpoint URL. Omit for the configured default.
ifNotExistsboolean
keyspacestringKeyspace. Omit for the configured/default keyspace.

create_index Create table index

Create an index on a table column: regular (filtering and sorting), vector (similarity search on a vector column), or text (BM25 lexical search). Collections index fields automatically.

ParameterTypeDescription
column *stringColumn to index.
name *stringIndex name.
table *stringTable name (collections index automatically; use indexing on create_collection).
databasestringDatabase to use: name, id, or Data API endpoint URL. Omit for the configured default.
ifNotExistsboolean
keyspacestringKeyspace. Omit for the configured/default keyspace.
optionsobjecte.g. {"metric": "dot_product"} for vector, {"caseSensitive": false} for regular.
typestringregular (filtering), vector (similarity), text (BM25).

drop Drop collection, table, or index

Permanently drop a collection, a table, or a table index, with all its data. Always requires the user's explicit confirmation.

ParameterTypeDescription
kind *stringWhat to drop.
name *stringName of the collection, table, or table index.
confirmstringSet ONLY after you described the impact and the user approved it in a later message: the exact target name. The original request is not approval; never guess or self-approve.
databasestringDatabase to use: name, id, or Data API endpoint URL. Omit for the configured default.
keyspacestringKeyspace. Omit for the configured/default keyspace.