polydb
PolyDB: one API key, every data shape your agent needs PolyDB is a hosted multi-model database made for AI agents.
Что умеет
- Query Sql: Execute raw SQL query on PolyDB. Only read-only queries are permitted (SELECT, WITH, EXPLAIN, SHOW). Write operations (INSERT, UPDATE, DELETE, DROP, etc.) are rejected. Args: query: SQL que
- List Tables: List tables in your agent database, or describe one table's columns in detail. This introspects the AGENT database live (not a hardcoded list) and never shows PolyDB's own internal `polyd
- Store Document: Store JSON document in a collection. Args: collection: Collection name document: JSON document to store document_id: Optional document ID (generated if not provided) database: Optional
Какие данные видит
Нужен ли аккаунт
Нужен API-ключ из настроек сервиса
PolyDB: one API key, every data shape your agent needs
PolyDB is a hosted multi-model database made for AI agents. One API key gives your agent a private, isolated database that holds many kinds of data at once. You don't need to set up or connect a separate service for each kind.
What your agent can store and query
- Memory and knowledge: session-scoped memories with semantic recall (store_memory / recall_memory), plus tenant-wide knowledge learned once and reused (store_knowledge / search_knowledge)
- Vectors for RAG: store_vector / search_vectors, with collections created on first insert
- Documents and SQL: JSON documents, plus read-only SQL over your tables (query_sql, which accepts SELECT, WITH, EXPLAIN and SHOW)
- Key-value with TTL
- Graphs: nodes, edges and graph queries
- Time-series and temporal: metrics over time, and time-travel queries on versioned entities
- Geospatial: nearby and bounding-box search
- Full-text search
- Files: blobs and S3-compatible object storage
- Streams: publish and consume
Made for agents
- 69 tools with typed input and output schemas. search_schema returns the catalog grouped by data type.
- Multiple named databases per account. Pass database on any call to pick one.
- Stable error codes. Auth errors include how_to_fix and ready-to-paste setup snippets, so an agent can tell a human exactly what to fix.
- Tenant isolation. Every request is scoped to the account that owns the key, and you can't see other tenants' data.
Getting started: get an API key at https://beta.polydb.dev/signup and paste it into the polydbApiKey field. Docs: https://beta.polydb.dev/docs
Как подключить
Как подключить polydb к Claude
Адрес сервера, который нужно вставить в настройках Claude:
https://polydb--richard-white.run.tools
- Откройте Claude (сайт claude.ai или приложение для компьютера).
- Перейдите в Настройки → Коннекторы (в английском интерфейсе: Settings → Connectors).
- Нажмите Добавить пользовательский коннектор (Add custom connector).
- Вставьте адрес сервера, скопированный ниже, в поле URL удалённого MCP-сервера и нажмите Добавить.
- В чате нажмите + → Коннекторы и включите новый коннектор.
Пользовательские коннекторы доступны на тарифах Free, Pro, Max, Team и Enterprise. На Free можно добавить только один. В Team и Enterprise коннектор сначала добавляет владелец организации в Настройки организации → Коннекторы.
Авторизация
После нажатия Добавить откроется окно входа в сервис. Войдите под своим аккаунтом и подтвердите доступ. Пароль Claude не видит.
Как подключить polydb к ChatGPT
Адрес сервера, который нужно вставить в настройках ChatGPT:
https://polydb--richard-white.run.tools
- Откройте ChatGPT в браузере (chatgpt.com). Нужен тариф Plus, Pro, Business, Enterprise или Edu.
- Один раз включите режим разработчика: Настройки → Приложения → Дополнительные настройки → Режим разработчика (Settings → Apps → Advanced settings → Developer mode).
- Откройте Настройки → Коннекторы и нажмите Создать (Create).
- Заполните форму: Название (любое), Описание (одна фраза, что делает сервис), URL MCP-сервера (скопируйте ниже).
- В поле Аутентификация выберите OAuth, если сервис требует вход, иначе Нет. Нажмите Создать.
- В новом чате откройте + → Приложения/Коннекторы и включите коннектор.
Название раздела у OpenAI менялось (Connectors → Apps/Plugins). Если пункт называется иначе, ищите «режим разработчика» в настройках. В рабочих пространствах Business/Enterprise администратор должен разрешить пользовательские коннекторы.
Авторизация
При первом использовании ChatGPT откроет окно входа в сервис. Войдите и подтвердите доступ.
Как подключить polydb к Cursor
Адрес сервера, который нужно вставить в настройках Cursor:
https://polydb--richard-white.run.tools
Быстрый способ: нажмите кнопку Открыть в Cursor ниже, Cursor сам предложит добавить сервер.
Вручную:
- В Cursor откройте Settings → Cursor Settings → MCP и нажмите Add new global MCP server.
- Вставьте JSON, скопированный ниже, в открывшийся файл
~/.cursor/mcp.json(для одного проекта:.cursor/mcp.jsonв корне проекта). - Сохраните файл. Сервер появится в списке MCP; при необходимости пройдите авторизацию по кнопке рядом с ним.
Авторизация
Если сервис требует вход, рядом с сервером в списке MCP появится кнопка авторизации.
Список инструментов сервера (60)
Технические названия из tools/list. Нужны только разработчикам.
| query_sql | Execute raw SQL query on PolyDB. Only read-only queries are permitted (SELECT, WITH, EXPLAIN, SHOW). Write operations (INSERT, UPDATE, DELETE, DROP, etc.) are rejected. Args: query: SQL query to execute (read-only) params: Optional query parameters database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with query results (rows, columns, count) |
| list_tables | List tables in your agent database, or describe one table's columns in detail. This introspects the AGENT database live (not a hardcoded list) and never shows PolyDB's own internal `polydb_*` infrastructure tables. Use it to discover what tables you (the agent) have created via `create_table`, then read them with `query_sql`. Pass `table` to get full column detail for that one table instead of the table listing (this absorbs what would otherwise be a separate `describe_table` tool). Args: table: Optional table name. If given, returns column detail for that table instead of the table listing. database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Without `table`: Dict with {"tables": [str, ...], "count": int}. With `table`: Dict with {"table": str, "columns": [{name, type, nullable, default, primary_key, position}, ...]}. |
| store_document | Store JSON document in a collection. Args: collection: Collection name document: JSON document to store document_id: Optional document ID (generated if not provided) database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with document_id |
| search_documents | Query documents in a collection. Args: collection: Collection name filter: JSON filter query limit: Maximum number of results database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with matching documents |
| get_document | Get document by ID. Args: collection: Collection name document_id: Document ID database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with document or error if not found |
| delete_document | Delete document. Args: collection: Collection name document_id: Document ID database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with success status |
| store_vector | Store embedding vector with metadata. Args: collection: Vector collection name vector: Embedding vector (array of floats) vector_id: Optional vector ID (generated if not provided) metadata: Optional metadata database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with vector_id |
| search_vectors | Semantic similarity search on vector embeddings. Args: collection: Vector collection name query_vector: Query vector for similarity search k: Number of nearest neighbors to return metadata_filter: Optional dict of metadata equality constraints, e.g. {"category": "docs"}. Only vectors whose metadata matches all pairs are returned. On the cloud (pgvector) and SQLite strategies the filter is applied before the top-k cut (pre-limit, exact). On the embedded FAISS strategy it is applied over the top 10×k nearest candidates (an approximation — a match ranked beyond the 10×k nearest may be missed). database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with similar vectors and distances |
| delete_vector | Delete vector by ID. Args: collection: Vector collection name vector_id: Vector ID to delete database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with deletion status |
| add_graph_node | Add node to graph. Args: node_id: Node identifier properties: Node properties node_type: Optional node type/label database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with node creation result |
| add_graph_edge | Add edge between nodes in graph. Args: from_node: Source node ID to_node: Target node ID edge_type: Optional edge type/label properties: Edge properties database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with edge creation result |
| query_graph | Query graph with traversal pattern. Args: start_node: Starting node ID pattern: Traversal pattern (e.g., 'neighbors', 'shortest_path') depth: Maximum traversal depth database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with traversal results |
| delete_graph_node | Delete graph node. Args: node_id: Node ID to delete database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with deletion status |
| delete_graph_edge | Delete graph edge. Args: edge_id: Edge ID to delete database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with deletion status |
| set_keyvalue | Set key-value pair with optional TTL. Args: key: Key name value: Value to store (any JSON-serializable type) namespace: Namespace for the key (default: "default") ttl: Time-to-live in seconds (optional) database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with success status and key details |
| get_keyvalue | Get value by key. Args: key: Key name namespace: Namespace for the key (default: "default") database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with key and value (None if key doesn't exist) |
| delete_keyvalue | Delete key-value pair. Args: key: Key name namespace: Namespace for the key (default: "default") database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with deletion status |
| list_keyvalues | List all keys in namespace. Args: namespace: Namespace to list keys from (default: "default") database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with keys list and count |
| publish_stream | Publish event to stream. Args: stream_name: Name of the stream event_data: Event payload data database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with publish status and event details |
| consume_stream | Consume events from stream. Events are returned in ascending ingestion order (oldest first), enabling deterministic replay. Use `next_cursor` from the response to page forward without re-scanning events already consumed. Args: stream_name: Name of the stream limit: Maximum number of events to return (default: 10) cursor: Opaque pagination cursor from a previous call's `next_cursor`. Omit (or pass null) to start from the beginning of the stream. database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with events list, count, and next_cursor (null when end-of-stream) |
| store_spatial | Store spatial geometry with attributes. Args: table_name: Name of spatial table geometry: Geometry as WKT string or GeoJSON dict attributes: Optional attributes for the geometry database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with feature_id and geometry details |
| search_spatial_nearby | Search for nearby spatial features within radius. Args: table_name: Name of spatial table longitude: Longitude of search point latitude: Latitude of search point radius_meters: Search radius in meters limit: Maximum number of results (default: 10) database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with nearby features and distances |
| search_spatial_bbox | Search spatial features within bounding box. Args: table_name: Name of spatial table min_lon: Minimum longitude min_lat: Minimum latitude max_lon: Maximum longitude max_lat: Maximum latitude limit: Maximum number of results (default: 10) database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with features within bounding box |
| delete_spatial | Delete spatial feature by ID. Args: table_name: Name of spatial table feature_id: ID of feature to delete database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with deletion status |
| store_timeseries | Store time-series data point. Args: metric: Metric name value: Numeric value to store timestamp: ISO timestamp (optional, defaults to now) tags: Optional tags for the data point database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with storage status and point details |
| query_timeseries | Query time-series data over time range with aggregation. Args: metric: Metric name start_time: Start timestamp (ISO format) end_time: End timestamp (ISO format) aggregation: Aggregation function (avg, sum, min, max, count) database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with aggregated time-series results |
| create_analytics_cube | Create OLAP analytics cube from fact table. Args: cube_name: Name for the cube fact_table: Source fact table name dimensions: List of dimension column names measures: List of measure column names database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with cube creation status |
| query_analytics | Query analytics cube with dimensional aggregation. Args: cube_name: Name of the cube dimensions: Dimensions to group by (optional) measures: Measures to aggregate (optional) filters: Filter conditions (optional) database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with aggregated results |
| delete_analytics_cube | Delete analytics cube. Args: cube_name: Name of the cube to delete database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with deletion status |
| put_s3_object | Upload object to S3 bucket. Args: bucket: Bucket name key: Object key (path) content: Object content content_type: MIME type (optional) database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with upload status and object details |
| get_s3_object | Get object from S3 bucket. Args: bucket: Bucket name key: Object key (path) database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with object content and metadata |
| list_s3_objects | List objects in S3 bucket. Args: bucket: Bucket name prefix: Key prefix filter (optional) database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with object list and count |
| delete_s3_object | Delete object from S3 bucket. Args: bucket: Bucket name key: Object key (path) database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with deletion status |
| create_bucket | Create an S3 bucket (idempotent — safe to call even if the bucket already exists). Args: bucket: Bucket name (3-63 chars, lowercase letters/digits/hyphens/dots only) region: AWS region hint; falls back to tenant S3 config region database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with created flag. {"created": true} on first creation, {"created": false, "already_existed": true} if bucket already exists. |
| delete_bucket | Delete an S3 bucket. The bucket must be empty before deletion. Args: bucket: Bucket name to delete database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with success flag. |
| list_buckets | List all S3 buckets for the authenticated tenant. Args: database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with buckets list and count. {"buckets": [...], "count": N} |
| store_temporal | Store data with temporal versioning. Args: entity_id: Unique entity identifier data: Data to store timestamp: ISO timestamp (optional, defaults to now) database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with version details |
| query_temporal_at | Query temporal data at specific time point. Args: entity_id: Unique entity identifier timestamp: ISO timestamp to query database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with data at specified time |
| query_temporal_history | Query temporal data history over time range. Args: entity_id: Unique entity identifier start_time: Start timestamp (ISO format) end_time: End timestamp (ISO format) database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with history of versions |
| index_fulltext | Index document for full-text search. Args: index_name: Name of the FTS index doc_id: Unique document identifier document: Text content to index database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with indexing status |
| search_fulltext | Full-text search with BM25 ranking. Args: index_name: Name of the FTS index query: Search query string limit: Maximum number of results (default: 10) database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with ranked search results |
| delete_fulltext | Delete document from full-text index. Args: index_name: Name of the FTS index doc_id: Document identifier to delete database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with deletion status |
| store_blob | Store binary blob with metadata. Args: content: Blob content (base64 encoded for binary data) filename: Optional filename mime_type: Optional MIME type metadata: Optional metadata dict database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with blob_id and storage details |
| get_blob | Get blob by ID. Args: blob_id: Unique blob identifier database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with blob content and metadata |
| delete_blob | Delete blob by ID. Args: blob_id: Unique blob identifier database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with deletion status |
| store_memory | Store agent interaction with automatic memory classification. Args: user_input: User's input text llm_response: LLM's response text session_id: Optional session identifier interaction_type: Type (conversation, knowledge_acquisition, task_completion, reasoning) metadata: Optional metadata about the interaction database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with memory_id and classification results |
| recall_memory | Retrieve relevant context for LLM prompt enhancement. Args: query: Query or context for retrieval session_id: Optional session identifier. When provided, recall is scoped to that session — only memories stored under the same session_id are returned. When omitted, recall spans all sessions in this database. context_types: Types of context to include (conversational, semantic, temporal, procedural) max_items: Maximum number of context items to return database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with retrieved memories and context |
| store_knowledge | Store knowledge with automatic classification and indexing. Args: content: Knowledge content to store knowledge_type: Type of knowledge (semantic, procedural, episodic, factual) source: Optional source of the knowledge confidence: Confidence score (0.0-1.0) metadata: Optional metadata database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with knowledge_id and classification results |
| search_knowledge | Query stored knowledge with filtering. Args: query: Query string knowledge_types: Types of knowledge to search min_confidence: Minimum confidence threshold limit: Maximum number of results database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with matching knowledge items |
| delete_memory | Delete specific memory/interaction. Args: memory_id: Unique memory identifier database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with deletion status |
| delete_knowledge | Remove knowledge entry from knowledge base. Args: knowledge_id: Unique knowledge identifier database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with deletion status |
| create_iceberg_table | Create a new Iceberg table with schema. Args: table_name: Name of the table to create schema: Column definitions as {column_name: data_type} partition_by: Optional list of columns to partition by properties: Optional table properties database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with table_id and table_name |
| append_iceberg | Append records to an Iceberg table. Args: table: Table name to append to data_records: List of row dicts to append database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with snapshot_id and record_count |
| get_iceberg_snapshot_as_of | Time-travel query to retrieve table state at a specific timestamp. Args: table: Table name timestamp: ISO 8601 timestamp to query as of database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with snapshot data at the given timestamp |
| add_iceberg_column | Add a column to an existing Iceberg table (schema evolution). Args: table: Table name column_name: Name of the new column column_type: Data type of the new column required: Whether the column is required (default: False) database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with table, column_name, and column_type |
| expire_iceberg_snapshots | Expire old snapshots to reclaim storage. Args: table: Table name retain_last_n: Number of recent snapshots to retain (default: 1) database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with table and retain_last_n |
| read_iceberg | Read rows from an Iceberg table (data, not just snapshot metadata). Supports column projection and time-travel: pass `snapshot_id` OR `as_of_timestamp` (ISO 8601) to read the table state at that point; omit both to read the latest snapshot. Args: table: Table name or table_id. columns: Optional list of columns to project. snapshot_id: Optional snapshot to read from (time-travel). as_of_timestamp: Optional ISO 8601 timestamp to read as of (time-travel). limit: Max rows to return (default 1000, hard max 10000). When the table has more rows, `truncated` is true. database: Optional named database within this tenant. If omitted, falls back to the X-PolyDB-Database header, then the tenant's default, then "polydb". ctx: FastMCP context (injected automatically) Returns: Dict with rows, row_count, truncated, table, snapshot_id. |
| list_databases | List databases in the tenant's project/cluster. Read-only discovery tool. Returns databases accessible to the current tenant, with the default/current database flagged. To create or delete databases, use the REST API at `/api/databases`. This tool enumerates the named databases available as targets for the ``database`` parameter on every dataplane tool (store_document, query_sql, store_vector, etc.). Pass one of the returned names as ``database='<name>'`` to scope a tool call to that database instead of the tenant default. System databases are not included (the underlying DatabaseRepository queries the user_databases table, never the system catalog). Note: a brand-new tenant whose default DB has not yet been materialized via the REST endpoint will see an empty list here — call POST /api/databases first. Returns: {"databases": [{"name": str, "current": bool, "created_at": str | None}, ...]} |
| search_schema | Discover all available MCP tools with their parameter signatures. Use this tool to explore what operations are available in PolyDB before deciding which tool to call. Returns a compact catalog of all registered tools with required and optional parameters. Args: filter: Optional provider name to filter results (e.g. 'document', 'vector', 'sql') ctx: FastMCP context (injected automatically) Returns: Dict with tools list, total count, and filter_applied |
| execute_workflow | Execute a multi-step workflow in one round-trip. Each step references a tool by name with arguments. Steps execute sequentially. Use $ref(stepId.field) to chain step outputs as inputs to later steps. Args: steps: List of step dicts, each with: - id: unique step identifier - op: tool name (e.g., "store_document") - args: tool arguments dict Named-database routing note (crit-1000): DSL steps inherit the same ``database`` precedence as discrete tool calls — if a step's ``args`` dict includes ``database='<name>'``, that value is consumed by the dispatch boundary (``_instrumented_call_tool``) and overrides the ``X-PolyDB-Database`` header or tenant default for that step only. Resolution order: args.database > X-PolyDB-Database header > tenant default > "polydb". |