/datastore-structured | Type: Embedded | PCID required: No
Tools
| Tool | Description |
|---|---|
datastore-structured_batch_create_items | Create multiple rows at once (max 500). More efficient than calling datastore-structured_create_item repeatedly. Call datastore-structured_get_collection first to discover column labels and select options. For “select” type fields, values MUST be one of the allowed options from the schema. |
datastore-structured_create_collection | Create a new datastore collection (table with defined columns/schema). For unstructured storage, use the datastore-unstructured server. Returns { id, isStructured, schema } - use the “id” field as collectionId for subsequent operations. |
datastore-structured_create_collection_from_csv | Create a new datastore from a CSV file. Auto-generates schema from CSV headers. Just provide a file URL and collection name - schema is inferred automatically. Returns { collectionId, imported, total, schema } - use the “collectionId” field for subsequent operations. |
datastore-structured_create_collection_with_template | Create a new datastore with a pre-built template. Templates include schema and sample data to get started quickly. Use datastore-structured_list_templates first to see available options. Returns { id, isStructured, schema } - use the “id” field as collectionId for subsequent operations. |
datastore-structured_create_item | Create a new row (or update if key exists). Call datastore-structured_get_collection first to discover column labels and select options. For “select” type fields, values MUST be one of the allowed options from the schema. Returns { id, key } - use “id” as itemId for get/update/delete operations. |
datastore-structured_delete_item | Delete a single row by itemId (recommended) or by key. Using key without sortField deletes ALL items with that key. Prefer itemId for precision. |
datastore-structured_delete_collection | Delete a datastore collection and all its data. Returns { message } on success. WARNING: This is a destructive operation that cannot be undone. |
datastore-structured_get_collection | REQUIRED: Get collection schema before any write operations. Returns column labels, field types, and allowed options for select fields. Always call this first to understand the table structure. |
datastore-structured_get_item | Get a single item (row) by its itemId. Use when you have the specific item ID from a previous operation. Returns full item data (content with field values, metadata, timestamps). For encrypted content, set decryptSecrets=true. |
datastore-structured_get_item_by_key | Get item(s) by their key. Use when you know the item key but not the itemId. Returns array of all items with matching key, or single item if sortField also provided. |
datastore-structured_import_data | Import data from a CSV file into an existing datastore. CSV column headers must match schema field labels. Returns { imported, total, failed } with counts. |
datastore-structured_list_collections | List all available structured datastore collections (tables with schemas). Returns an array of collections, each with { id, name, type, schema }. Use the “id” field as collectionId for subsequent operations. For unstructured data, use the datastore-unstructured server. |
datastore-structured_list_items | List/browse items (rows) with pagination and sorting. Returns items with pagination metadata (totalCount, hasNextPage, hasPrevPage). Use format=“full” to include item content, or “light” for metadata only. Supports sorting by any column name (e.g. “Amount:desc”) or system fields (createdAt, updatedAt, key, sortField). |
datastore-structured_list_templates | List available templates for creating datastores. Returns an array of templates, each with { id, name, description, category, schema }. Use the template “id” when calling datastore-structured_create_collection_with_template. |
datastore-structured_migrate_sortfield | Change default sort order and regenerate sortField for all items. Long-running (30-60s for large collections). Use when you need to change how items are ordered by default. |
datastore-structured_analytics_query | Run analytics on collection data using natural language. Translates questions into BigQuery aggregations (COUNT, SUM, AVG, MIN, MAX), groupings, computed columns, and filtered summaries. Returns dynamic columns and rows — not full datastore items. Use this for questions like “how many rows by status?”, “average salary by department”, “top 10 products by revenue”, “count of items created per month”. For filtering/returning full rows, use datastore-structured_natural_query instead. |
datastore-structured_natural_query | Query data using natural language. Two modes: |
translation object and pagination metadata.
To fetch the next page, pass the SAME translation back (this skips the LLM) and increment offset by your limit.
Example — page through 100 items at a time:
Page 1: { query: “active users”, mode: “natural-search”, limit: 100 }
Page 2: { query: “active users”, mode: “natural-search”, limit: 100, offset: 100, translation: <translation from page 1> }
Page 3: { query: “active users”, mode: “natural-search”, limit: 100, offset: 200, translation: <translation from page 1> }
Stop when pagination.hasNextPage is false.
RETURN ALL (natural-search only):
Set returnAll: true to fetch every matching row in one call (up to 50,000 rows).
WARNING: The response payload is limited to ~6 MB (AWS Lambda). Wide rows or large text fields may hit this before 50,000. If you get a payload error, switch to paginated mode with a smaller limit.
CHOOSING A LIMIT:
You control the page size via limit. Pick a value that balances throughput vs. payload size. Common choices: 100-500 for interactive use, 1000-5000 for batch processing, returnAll for workflows needing the full dataset. |
| datastore-structured_search | Search rows by text query with fuzzy/exact/prefix matching. Use when you need to find items containing specific text but don’t know their key or ID. Supports field-specific search (content, key, sortField). For structured queries, prefer datastore-structured_natural_query. |
| datastore-structured_update_item | Update an existing row by itemId (partial update). Provide only the fields you want to change - other fields remain unchanged. For “select” type fields, values MUST match one of the allowed options from the schema. Requires itemId (from create/list/get operations). |
| datastore-structured_update_schema | Modify schema to add/remove/rename columns. Field IDs (f_1, f_2) remain stable when renaming. Must provide complete schema with all fields. |
datastore-structured_batch_create_items
Create multiple rows at once (max 500). More efficient than calling datastore-structured_create_item repeatedly. Call datastore-structured_get_collection first to discover column labels and select options. For “select” type fields, values MUST be one of the allowed options from the schema. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
collectionId | string | Yes | — | Collection ID (not name) to add the items to - e.g. “KCny7nGXpBzWNYpJzC0b”. Use datastore-structured_list_collections tool to get collection ID. |
items | any | Yes | — | Array of items to create, each with key, content (string or object), optional metadata object, and optional sortField |
triggerChanges | boolean | No | true | Whether to trigger webhooks on change |
proxyId | string | No | — | Proxy ID to access a shared datastore collection. Requires X-API-Key header. |
datastore-structured_create_collection
Create a new datastore collection (table with defined columns/schema). For unstructured storage, use the datastore-unstructured server. Returns { id, isStructured, schema } - use the “id” field as collectionId for subsequent operations. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | Yes | — | Display name for the collection/table |
description | string | No | — | Optional description of the collection purpose |
type | string | No | "datastore" | Collection type - must be “datastore” |
createdBy | string | Yes | — | User ID creating the collection - use the current user ID or a service identifier |
createdByName | string | Yes | — | Display name shown as creator - use the current user name or service name |
templateId | string | No | "none" | Template ID - use “none” for custom schema |
schema | object | Yes | — | Schema definition with fields array defining the table columns. Example: { “fields”: [{“id”: “f_1”, “label”: “Name”, “type”: “string”}, {“id”: “f_2”, “label”: “Age”, “type”: “number”}], “nextFieldId”: 3 } |
datastore-structured_create_collection_from_csv
Create a new datastore from a CSV file. Auto-generates schema from CSV headers. Just provide a file URL and collection name - schema is inferred automatically. Returns { collectionId, imported, total, schema } - use the “collectionId” field for subsequent operations. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
fileUrl | string | Yes | — | URL to the CSV file (e.g. from filestorage, S3, or any publicly accessible URL) |
name | string | Yes | — | Name for the new datastore collection |
description | string | No | — | Optional description of the collection |
createdBy | string | Yes | — | User ID creating the collection - use the current user ID or a service identifier |
createdByName | string | Yes | — | Display name shown as creator - use the current user name or service name |
schema | object | No | — | Optional custom schema - if not provided, will be auto-generated from CSV headers |
datastore-structured_create_collection_with_template
Create a new datastore with a pre-built template. Templates include schema and sample data to get started quickly. Use datastore-structured_list_templates first to see available options. Returns { id, isStructured, schema } - use the “id” field as collectionId for subsequent operations. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | Yes | — | Display name for the new collection |
description | string | No | — | Optional description of the collection purpose |
templateId | string | Yes | — | Template ID from datastore-structured_list_templates (e.g. “customer-orders”, “inventory”, “contacts”). Call datastore-structured_list_templates first to see available options. |
createdBy | string | Yes | — | User ID creating the collection - use the current user ID or a service identifier |
createdByName | string | Yes | — | Display name shown as creator - use the current user name or service name |
datastore-structured_create_item
Create a new row (or update if key exists). Call datastore-structured_get_collection first to discover column labels and select options. For “select” type fields, values MUST be one of the allowed options from the schema. Returns { id, key } - use “id” as itemId for get/update/delete operations. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
collectionId | string | Yes | — | Collection ID (not name) to add the item to - e.g. “KCny7nGXpBzWNYpJzC0b”. Use datastore-structured_list_collections tool to get collection ID. |
key | string | Yes | — | Unique identifier key for the row within the collection (required) |
content | any | Yes | — | Content object (required). Use column labels from the schema as keys (e.g. {“Name”: “John Doe”, “Email”: “john@example.com”}). For “select” type fields, value MUST be one of the allowed options from the schema. |
sortField | string | No | — | Optional sort field for organizing items |
metadata | object | No | — | Optional metadata object for categorization and organization (e.g. {“customField1”: “Custom attribute 1”, “customField2”: “Custom attribute 2”}) |
triggerChanges | boolean | No | true | Whether to trigger webhooks on change |
proxyId | string | No | — | Proxy ID to access a shared datastore collection. Requires X-API-Key header. |
datastore-structured_delete_item
Delete a single row by itemId (recommended) or by key. Using key without sortField deletes ALL items with that key. Prefer itemId for precision. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
collectionId | string | Yes | — | Collection ID (not name) that the item belongs to - e.g. “KCny7nGXpBzWNYpJzC0b”. Use datastore-structured_list_collections tool to get collection ID. |
itemId | string | No | — | Item ID to delete (recommended method - use either itemId or key, not both) |
key | string | No | — | Item key to delete (alternative method - use either itemId or key, not both). Key values are URL-encoded automatically. |
sortField | string | No | — | Sort field to delete a specific key+sortField combination (only used with key parameter) |
proxyId | string | No | — | Proxy ID to access a shared datastore collection. Requires X-API-Key header. |
datastore-structured_delete_collection
Delete a datastore collection and all its data. Returns { message } on success. WARNING: This is a destructive operation that cannot be undone. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
collectionId | string | Yes | — | Collection ID to delete - e.g. “KCny7nGXpBzWNYpJzC0b”. Use datastore-structured_list_collections tool to get collection ID. |
datastore-structured_get_collection
REQUIRED: Get collection schema before any write operations. Returns column labels, field types, and allowed options for select fields. Always call this first to understand the table structure. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
collectionId | string | Yes | — | Collection ID to get details for - e.g. “KCny7nGXpBzWNYpJzC0b” |
datastore-structured_get_item
Get a single item (row) by its itemId. Use when you have the specific item ID from a previous operation. Returns full item data (content with field values, metadata, timestamps). For encrypted content, set decryptSecrets=true. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
collectionId | string | Yes | — | Collection ID (not name) that the item belongs to - e.g. “KCny7nGXpBzWNYpJzC0b”. Use datastore-structured_list_collections tool to get collection ID. |
itemId | string | Yes | — | Unique datastore item ID to retrieve (itemId, not key) |
decryptSecrets | boolean | No | false | Whether to decrypt secrets if item contains encrypted data |
proxyId | string | No | — | Proxy ID to access a shared datastore collection. Requires X-API-Key header. |
datastore-structured_get_item_by_key
Get item(s) by their key. Use when you know the item key but not the itemId. Returns array of all items with matching key, or single item if sortField also provided. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
collectionId | string | Yes | — | Collection ID (not name) that the item belongs to - e.g. “KCny7nGXpBzWNYpJzC0b” |
key | string | Yes | — | Unique key identifier for the item within the collection |
sortField | string | No | — | Optional sort field to uniquely identify the item when multiple items have the same key |
proxyId | string | No | — | Proxy ID to access a shared datastore collection. Requires X-API-Key header. |
datastore-structured_import_data
Import data from a CSV file into an existing datastore. CSV column headers must match schema field labels. Returns { imported, total, failed } with counts. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
collectionId | string | Yes | — | Collection ID of existing datastore - e.g. “KCny7nGXpBzWNYpJzC0b” |
fileUrl | string | Yes | — | URL to the CSV file (e.g. from filestorage, S3, or any publicly accessible URL) |
datastore-structured_list_collections
List all available structured datastore collections (tables with schemas). Returns an array of collections, each with { id, name, type, schema }. Use the “id” field as collectionId for subsequent operations. For unstructured data, use the datastore-unstructured server. Parameters: Nonedatastore-structured_list_items
List/browse items (rows) with pagination and sorting. Returns items with pagination metadata (totalCount, hasNextPage, hasPrevPage). Use format=“full” to include item content, or “light” for metadata only. Supports sorting by any column name (e.g. “Amount:desc”) or system fields (createdAt, updatedAt, key, sortField). Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
collectionId | string | Yes | — | Collection ID (not name) - e.g. “KCny7nGXpBzWNYpJzC0b”. Use datastore-structured_list_collections tool to get collection ID. |
limit | number | No | 50 | Maximum number of items to return (default: 50, max: 1000) |
offset | number | No | — | Offset for pagination (default: 0). Use with limit to page through results. Example: limit=50&offset=50 for page 2. |
orderedBy | string | No | "createdAt:desc" | Sorting field and direction - format: “<field>:<asc|desc>“ |
format | string | No | "light" | Response format: “light” for minimal info (id, createdAt, sortField, key, updatedAt), “full” for complete data |
proxyId | string | No | — | Proxy ID to access a shared datastore collection. Requires X-API-Key header. |
datastore-structured_list_templates
List available templates for creating datastores. Returns an array of templates, each with { id, name, description, category, schema }. Use the template “id” when calling datastore-structured_create_collection_with_template. Parameters: Nonedatastore-structured_migrate_sortfield
Change default sort order and regenerate sortField for all items. Long-running (30-60s for large collections). Use when you need to change how items are ordered by default. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
collectionId | string | Yes | — | Collection ID of a datastore - e.g. “KCny7nGXpBzWNYpJzC0b” |
sortConfig | object | Yes | — | New sort configuration to apply to all items |
datastore-structured_analytics_query
Run analytics on collection data using natural language. Translates questions into BigQuery aggregations (COUNT, SUM, AVG, MIN, MAX), groupings, computed columns, and filtered summaries. Returns dynamic columns and rows — not full datastore items. Use this for questions like “how many rows by status?”, “average salary by department”, “top 10 products by revenue”, “count of items created per month”. For filtering/returning full rows, use datastore-structured_natural_query instead. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
collectionId | string | Yes | — | Collection ID of a structured datastore (must have schema) - e.g. “KCny7nGXpBzWNYpJzC0b” |
query | string | Yes | — | Natural language analytics question - e.g. “how many items per status?”, “average population by continent”, “top 5 countries by GDP”, “count of active vs inactive”, “total revenue by month” |
limit | number | No | 10000 | Maximum number of result rows to return (default 10000, max 50000). For aggregations this is usually small. |
proxyId | string | No | — | Proxy ID to access a shared datastore collection. Requires X-API-Key header. |
datastore-structured_natural_query
Query data using natural language. Two modes: • “natural-search” — filters and returns matching rows (e.g. “active users from last week”). • “natural-answer” — generates an AI analysis with calculations (e.g. “what is average age?”). PAGINATION (natural-search only): The first call translates your query into SQL via an LLM. The response includes atranslation object and pagination metadata.
To fetch the next page, pass the SAME translation back (this skips the LLM) and increment offset by your limit.
Example — page through 100 items at a time:
Page 1: { query: “active users”, mode: “natural-search”, limit: 100 }
Page 2: { query: “active users”, mode: “natural-search”, limit: 100, offset: 100, translation: <translation from page 1> }
Page 3: { query: “active users”, mode: “natural-search”, limit: 100, offset: 200, translation: <translation from page 1> }
Stop when pagination.hasNextPage is false.
RETURN ALL (natural-search only):
Set returnAll: true to fetch every matching row in one call (up to 50,000 rows).
WARNING: The response payload is limited to ~6 MB (AWS Lambda). Wide rows or large text fields may hit this before 50,000. If you get a payload error, switch to paginated mode with a smaller limit.
CHOOSING A LIMIT:
You control the page size via limit. Pick a value that balances throughput vs. payload size. Common choices: 100-500 for interactive use, 1000-5000 for batch processing, returnAll for workflows needing the full dataset.
Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
collectionId | string | Yes | — | Collection ID of a datastore (must have schema) - e.g. “KCny7nGXpBzWNYpJzC0b” |
query | string | Yes | — | Natural language query - e.g. “find high priority cases from last week” for search mode, or “what is the average age?” for answer mode |
mode | string | Yes | — | Query mode: “natural-search” returns filtered rows, “natural-answer” returns AI-generated analysis with insights |
limit | number | No | — | Page size — number of items to return per request (default: 1000, max: 50000). Only applies to natural-search mode. Choose based on your use case: 100-500 for interactive browsing, 1000-5000 for batch processing. The response payload is capped at ~6 MB, so very wide rows may require a smaller limit. |
offset | number | No | — | Number of items to skip (default: 0). Only applies to natural-search mode. To page through results: set offset = 0 for page 1, offset = limit for page 2, offset = limit * 2 for page 3, etc. Always pass the translation from the first response when using offset > 0 to avoid redundant LLM calls. |
returnAll | boolean | No | — | When true, fetches ALL matching items in a single call (up to 50,000 rows). Only applies to natural-search mode. Use in workflows when you need the complete result set. WARNING: Response payload is limited to ~6 MB. If rows are wide (many columns, large text), you may hit the payload limit before 50,000 rows. In that case, use paginated mode instead. |
translation | any | No | — | Cached SQL translation from a previous response. IMPORTANT: When provided, the LLM call is skipped entirely and the query goes straight to BigQuery — this is faster and cheaper. Always pass this on page 2+ to avoid re-translating the same query. Copy the entire translation object from the first page response and send it unchanged. |
proxyId | string | No | — | Proxy ID to access a shared datastore collection. Requires X-API-Key header. |
datastore-structured_search
Search rows by text query with fuzzy/exact/prefix matching. Use when you need to find items containing specific text but don’t know their key or ID. Supports field-specific search (content, key, sortField). For structured queries, prefer datastore-structured_natural_query. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
collectionId | string | Yes | — | Collection ID (not name) to search in - e.g. “KCny7nGXpBzWNYpJzC0b”. Use datastore-structured_list_collections tool to get collection ID. |
q | string | Yes | — | Search query string to find in documents (required). For multi-word queries, words must be adjacent in the source text (phrase-based search). Example: “quick brown” matches “The quick brown fox” but “quick fox” won’t match if words are separated. |
field | string | No | "all" | Field to search: “all” for comprehensive search, “content” for main item content, “key” for primary identifier, “sortField” for secondary identifier. |
type | string | No | "fuzzy" | Search type: “fuzzy” (default - handles typos), “exact” (precise matches), “prefix” (starts with) |
threshold | number | No | 0.3 | Fuzzy matching sensitivity from 0.0 (strict) to 1.0 (lenient), default: 0.3 |
limit | number | No | 50 | Maximum number of results to return (default: 50, max: 1000) |
compiled | boolean | No | false | Output format: false (default - JSON with snippets & scores), true (plain text with full content, RAG-like) |
queryParams | object | No | {} | Pre-filter by document fields using “content.” or “metadata.” keys (e.g. {“metadata.category”: “work”}) |
proxyId | string | No | — | Proxy ID to access a shared datastore collection. Requires X-API-Key header. |
datastore-structured_update_item
Update an existing row by itemId (partial update). Provide only the fields you want to change - other fields remain unchanged. For “select” type fields, values MUST match one of the allowed options from the schema. Requires itemId (from create/list/get operations). Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
collectionId | string | Yes | — | Collection ID (not name) that the item belongs to - e.g. “KCny7nGXpBzWNYpJzC0b”. Use datastore-structured_list_collections tool to get collection ID. |
itemId | string | Yes | — | Item ID to update (itemId not the key). Can be obtained when creating the item or by listing/getting/searching items. Required for updates. |
content | any | Yes | — | Updated content object (required). Use column labels from the schema as keys (e.g. {“Status”: “Closed”}). Only provided fields are updated; others remain unchanged. For “select” type fields, value MUST be one of the allowed options from the schema. |
metadata | object | No | — | Optional updated metadata object with key-value pairs. Only provided metadata fields are updated; original key and sortField are preserved. |
triggerChanges | boolean | No | true | Whether to trigger webhooks on change |
proxyId | string | No | — | Proxy ID to access a shared datastore collection. Requires X-API-Key header. |
datastore-structured_update_schema
Modify schema to add/remove/rename columns. Field IDs (f_1, f_2) remain stable when renaming. Must provide complete schema with all fields. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
collectionId | string | Yes | — | Collection ID to update schema for - e.g. “KCny7nGXpBzWNYpJzC0b”. Use datastore-structured_list_collections to find the collection ID. |
schema | object | Yes | — | Complete schema object with all fields. WORKFLOW: 1) Call datastore-structured_get_collection to get current schema, 2) Modify the fields array (add/remove/rename fields), 3) Update nextFieldId if adding fields, 4) Provide the complete modified schema. IMPORTANT: Include ALL existing fields plus any new ones - this replaces the entire schema. |

