fix(algolia): fix serialization-time param mutation, add geo/facet search, task status tool

- move all tools.config coercion/remapping out of tool() into a proper params() function so dynamic block references aren't destroyed before variable resolution
- wire facets and getRankingInfo into the search tool so those documented outputs are actually reachable
- add geo-search (aroundLatLng/aroundRadius/insideBoundingBox/insidePolygon) to search and browse_records, matching delete_by_filter
- fix aroundRadius param type (string, not number, since it accepts "all")
- sync batch_operations description with the real action set (delete, clear)
- consolidate list_indices pagination into the shared page/hitsPerPage fields instead of duplicate listPage/listHitsPerPage
- add algolia_get_task_status tool so workflows can poll a taskID instead of guessing when a write is applied
- trim indexName/objectID/destination before building request URLs
- add ranking-tuning and index-snapshot skills to AlgoliaBlockMeta

fix(dropcontact): swap icon to the official wordmark's teal swirl mark, bgColor to match

chore(grafana): bgColor to white to match brand tile convention
This commit is contained in:
waleed
2026-07-01 23:45:27 -07:00
parent 220da449c9
commit a38c74db03
26 changed files with 356 additions and 82 deletions
+6 -8
View File
@@ -7985,18 +7985,16 @@ export function LeadMagicIcon(props: SVGProps<SVGSVGElement>) {
)
}
/** Dropcontact brand icon: teal disc with the white open-"d" contact mark. */
/** Dropcontact brand icon: the teal swirl mark from the official wordmark. */
export function DropcontactIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg {...props} viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'>
<circle cx='12' cy='12' r='12' fill='#0ABA9F' />
<svg {...props} viewBox='0 0 50 50' fill='none' xmlns='http://www.w3.org/2000/svg'>
<path
d='M13.87 7.9A5 5 0 1 0 13.87 16.1'
stroke='#FFFFFF'
strokeWidth='2.4'
strokeLinecap='round'
fillRule='evenodd'
clipRule='evenodd'
d='M29.57 16.22a10.84 10.84 0 0 0-4.698-1.064c-6.01 0-10.88 4.872-10.88 10.88s4.872 10.88 10.88 10.88c4.09 0 7.655-2.258 9.513-5.596l-2.623-1.457a7.88 7.88 0 0 1-6.89 4.053c-4.353 0-7.88-3.528-7.88-7.88s3.528-7.88 7.88-7.88a7.85 7.85 0 0 1 3.403.77l1.295-2.707zm5.21-14.235v25.762h-3.11V.9C29.546.313 27.3 0 25 0 11.193 0 0 11.193 0 25s11.193 25 25 25 25-11.193 25-25c0-10.337-6.274-19.21-15.222-23.016z'
fill='#0ABA9F'
/>
<path d='M15.1 6.2V17.8' stroke='#FFFFFF' strokeWidth='2.4' strokeLinecap='round' />
</svg>
)
}
@@ -50,6 +50,12 @@ Search an Algolia index
| `page` | number | No | Page number to retrieve \(default: 0\) |
| `filters` | string | No | Filter string \(e.g., "category:electronics AND price &lt; 100"\) |
| `attributesToRetrieve` | string | No | Comma-separated list of attributes to retrieve |
| `facets` | string | No | Comma-separated list of facet attribute names to retrieve counts for \(use "*" for all\) |
| `getRankingInfo` | boolean | No | Whether to include detailed ranking information in each hit |
| `aroundLatLng` | string | No | Coordinates for geo-search \(e.g., "40.71,-74.01"\) |
| `aroundRadius` | string | No | Maximum radius in meters for geo-search, or "all" for unlimited |
| `insideBoundingBox` | json | No | Bounding box coordinates as \[\[lat1, lng1, lat2, lng2\]\] for geo-search |
| `insidePolygon` | json | No | Polygon coordinates as \[\[lat1, lng1, lat2, lng2, lat3, lng3, ...\]\] for geo-search |
#### Output
@@ -200,6 +206,10 @@ Browse and iterate over all records in an Algolia index using cursor pagination
| `attributesToRetrieve` | string | No | Comma-separated list of attributes to retrieve |
| `hitsPerPage` | number | No | Number of hits per page \(default: 1000, max: 1000\) |
| `cursor` | string | No | Cursor from a previous browse response for pagination |
| `aroundLatLng` | string | No | Coordinates for geo-search \(e.g., "40.71,-74.01"\) |
| `aroundRadius` | string | No | Maximum radius in meters for geo-search, or "all" for unlimited |
| `insideBoundingBox` | json | No | Bounding box coordinates as \[\[lat1, lng1, lat2, lng2\]\] for geo-search |
| `insidePolygon` | json | No | Polygon coordinates as \[\[lat1, lng1, lat2, lng2, lat3, lng3, ...\]\] for geo-search |
#### Output
@@ -225,7 +235,7 @@ Perform batch add, update, partial update, or delete operations on records in an
| `applicationId` | string | Yes | Algolia Application ID |
| `apiKey` | string | Yes | Algolia Admin API Key |
| `indexName` | string | Yes | Name of the Algolia index |
| `requests` | json | Yes | Array of batch operations. Each item has "action" \(addObject, updateObject, partialUpdateObject, partialUpdateObjectNoCreate, deleteObject\) and "body" \(the record data, must include objectID for update/delete\) |
| `requests` | json | Yes | Array of batch operations. Each item has "action" \(addObject, updateObject, partialUpdateObject, partialUpdateObjectNoCreate, deleteObject, delete, clear\) and "body" \(the record data, must include objectID for update/delete; omit body for delete/clear\) |
#### Output
@@ -390,7 +400,7 @@ Delete all records matching a filter from an Algolia index
| `numericFilters` | json | No | Array of numeric filters \(e.g., \["price &gt; 100"\]\) |
| `tagFilters` | json | No | Array of tag filters using the _tags attribute \(e.g., \["published"\]\) |
| `aroundLatLng` | string | No | Coordinates for geo-search filter \(e.g., "40.71,-74.01"\) |
| `aroundRadius` | number | No | Maximum radius in meters for geo-search, or "all" for unlimited |
| `aroundRadius` | string | No | Maximum radius in meters for geo-search, or "all" for unlimited |
| `insideBoundingBox` | json | No | Bounding box coordinates as \[\[lat1, lng1, lat2, lng2\]\] for geo-search filter |
| `insidePolygon` | json | No | Polygon coordinates as \[\[lat1, lng1, lat2, lng2, lat3, lng3, ...\]\] for geo-search filter |
@@ -401,4 +411,24 @@ Delete all records matching a filter from an Algolia index
| `taskID` | number | Algolia task ID for tracking the delete-by-filter operation |
| `updatedAt` | string | Timestamp when the operation was performed |
### `algolia_get_task_status`
Check whether an Algolia indexing task has finished publishing
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `applicationId` | string | Yes | Algolia Application ID |
| `apiKey` | string | Yes | Algolia API Key |
| `indexName` | string | Yes | Name of the Algolia index the task ran against |
| `taskID` | number | Yes | The taskID returned by a previous write operation |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `status` | string | Task status: "published" once the operation has been applied, "notPublished" while still pending |
| `pendingTask` | boolean | Whether the task is still pending |
@@ -7,7 +7,7 @@ import { BlockInfoCard } from "@/components/ui/block-info-card"
<BlockInfoCard
type="dropcontact"
color="#0066FF"
color="#0ABA9F"
/>
{/* MANUAL-CONTENT-START:intro */}
@@ -7,7 +7,7 @@ import { BlockInfoCard } from "@/components/ui/block-info-card"
<BlockInfoCard
type="grafana"
color="#F46800"
color="#FFFFFF"
/>
{/* MANUAL-CONTENT-START:intro */}
+83 -40
View File
@@ -37,6 +37,7 @@ export const AlgoliaBlock: BlockConfig = {
{ label: 'Copy/Move Index', id: 'copy_move_index' },
{ label: 'Clear Records', id: 'clear_records' },
{ label: 'Delete By Filter', id: 'delete_by_filter' },
{ label: 'Get Task Status', id: 'get_task_status' },
],
value: () => 'search',
},
@@ -63,7 +64,7 @@ export const AlgoliaBlock: BlockConfig = {
title: 'Hits Per Page',
type: 'short-input',
placeholder: '20',
condition: { field: 'operation', value: ['search', 'browse_records'] },
condition: { field: 'operation', value: ['search', 'browse_records', 'list_indices'] },
mode: 'advanced',
},
{
@@ -71,7 +72,7 @@ export const AlgoliaBlock: BlockConfig = {
title: 'Page',
type: 'short-input',
placeholder: '0',
condition: { field: 'operation', value: 'search' },
condition: { field: 'operation', value: ['search', 'list_indices'] },
mode: 'advanced',
},
{
@@ -108,6 +109,26 @@ Return ONLY the filter string, no quotes or explanation.`,
condition: { field: 'operation', value: ['search', 'get_record', 'browse_records'] },
mode: 'advanced',
},
{
id: 'facets',
title: 'Facets',
type: 'short-input',
placeholder: 'category,brand (or * for all)',
condition: { field: 'operation', value: 'search' },
mode: 'advanced',
},
{
id: 'getRankingInfo',
title: 'Include Ranking Info',
type: 'dropdown',
options: [
{ label: 'No', id: 'false' },
{ label: 'Yes', id: 'true' },
],
value: () => 'false',
condition: { field: 'operation', value: 'search' },
mode: 'advanced',
},
// Browse cursor
{
id: 'cursor',
@@ -389,7 +410,7 @@ Return ONLY the filter string, no quotes or explanation.`,
title: 'Around Lat/Lng',
type: 'short-input',
placeholder: '40.71,-74.01',
condition: { field: 'operation', value: 'delete_by_filter' },
condition: { field: 'operation', value: ['delete_by_filter', 'search', 'browse_records'] },
mode: 'advanced',
},
{
@@ -397,7 +418,7 @@ Return ONLY the filter string, no quotes or explanation.`,
title: 'Around Radius (m)',
type: 'short-input',
placeholder: '1000 or "all"',
condition: { field: 'operation', value: 'delete_by_filter' },
condition: { field: 'operation', value: ['delete_by_filter', 'search', 'browse_records'] },
mode: 'advanced',
},
{
@@ -405,7 +426,7 @@ Return ONLY the filter string, no quotes or explanation.`,
title: 'Inside Bounding Box',
type: 'short-input',
placeholder: '[[47.3165,0.757,47.3424,0.8012]]',
condition: { field: 'operation', value: 'delete_by_filter' },
condition: { field: 'operation', value: ['delete_by_filter', 'search', 'browse_records'] },
mode: 'advanced',
},
{
@@ -413,7 +434,7 @@ Return ONLY the filter string, no quotes or explanation.`,
title: 'Inside Polygon',
type: 'short-input',
placeholder: '[[47.3165,0.757,47.3424,0.8012,47.33,0.78]]',
condition: { field: 'operation', value: 'delete_by_filter' },
condition: { field: 'operation', value: ['delete_by_filter', 'search', 'browse_records'] },
mode: 'advanced',
},
// Get records (batch) field
@@ -447,22 +468,14 @@ Return ONLY the JSON array.`,
generationType: 'json-object',
},
},
// List indices pagination
// Get task status field
{
id: 'listPage',
title: 'Page',
id: 'taskID',
title: 'Task ID',
type: 'short-input',
placeholder: '0',
condition: { field: 'operation', value: 'list_indices' },
mode: 'advanced',
},
{
id: 'listHitsPerPage',
title: 'Indices Per Page',
type: 'short-input',
placeholder: '100',
condition: { field: 'operation', value: 'list_indices' },
mode: 'advanced',
placeholder: '12345',
condition: { field: 'operation', value: 'get_task_status' },
required: { field: 'operation', value: 'get_task_status' },
},
// Object ID - for add (optional), get, partial update, delete
{
@@ -515,32 +528,42 @@ Return ONLY the JSON array.`,
'algolia_copy_move_index',
'algolia_clear_records',
'algolia_delete_by_filter',
'algolia_get_task_status',
],
config: {
tool: (params: Record<string, unknown>) => {
const op = params.operation as string
if (op === 'partial_update_record') {
params.createIfNotExists = params.createIfNotExists !== 'false'
tool: (params: Record<string, unknown>) => `algolia_${params.operation}`,
params: (params: Record<string, unknown>) => {
const { operation, ...rest } = params
const result: Record<string, unknown> = {}
for (const [key, value] of Object.entries(rest)) {
if (value === undefined || value === null || value === '') continue
result[key] = value
}
if (op === 'update_settings' && params.forwardToReplicas === 'true') {
params.forwardToReplicas = true
} else if (op === 'update_settings') {
params.forwardToReplicas = false
if (operation === 'partial_update_record') {
result.createIfNotExists = result.createIfNotExists !== 'false'
}
if (op === 'copy_move_index') {
params.operation = params.copyMoveOperation
if (operation === 'update_settings') {
result.forwardToReplicas = result.forwardToReplicas === 'true'
}
if (op === 'delete_by_filter') {
params.filters = params.deleteFilters
if (operation === 'search' && result.getRankingInfo !== undefined) {
result.getRankingInfo = result.getRankingInfo === 'true'
}
if (op === 'get_records') {
params.requests = params.getRecordsRequests
if (operation === 'copy_move_index') {
result.operation = result.copyMoveOperation
result.copyMoveOperation = undefined
}
if (op === 'list_indices') {
if (params.listPage !== undefined) params.page = params.listPage
if (params.listHitsPerPage !== undefined) params.hitsPerPage = params.listHitsPerPage
if (operation === 'delete_by_filter') {
result.filters = result.deleteFilters
result.deleteFilters = undefined
}
return `algolia_${op}`
if (operation === 'get_records') {
result.requests = result.getRecordsRequests
result.getRecordsRequests = undefined
}
return result
},
},
},
@@ -553,6 +576,8 @@ Return ONLY the JSON array.`,
page: { type: 'string', description: 'Page number' },
filters: { type: 'string', description: 'Algolia filter string' },
attributesToRetrieve: { type: 'string', description: 'Attributes to retrieve' },
facets: { type: 'string', description: 'Comma-separated facet attribute names to count' },
getRankingInfo: { type: 'string', description: 'Include detailed ranking info in each hit' },
cursor: { type: 'string', description: 'Browse cursor for pagination' },
record: { type: 'json', description: 'Record data to add' },
attributes: { type: 'json', description: 'Attributes to partially update' },
@@ -579,8 +604,7 @@ Return ONLY the JSON array.`,
type: 'json',
description: 'Array of objects with objectID to retrieve multiple records',
},
listPage: { type: 'string', description: 'Page number for list indices pagination' },
listHitsPerPage: { type: 'string', description: 'Indices per page for list indices' },
taskID: { type: 'string', description: 'Task ID returned by a previous write operation' },
applicationId: { type: 'string', description: 'Algolia Application ID' },
apiKey: { type: 'string', description: 'Algolia API Key' },
},
@@ -644,6 +668,11 @@ Return ONLY the JSON array.`,
type: 'number',
description: 'Maximum number of hits accessible via pagination (default 1000)',
},
status: {
type: 'string',
description: 'Task status: "published" once applied, "notPublished" while still pending',
},
pendingTask: { type: 'boolean', description: 'Whether the task is still pending' },
},
}
@@ -739,5 +768,19 @@ export const AlgoliaBlockMeta = {
content:
'# Audit Search Relevance\n\nCheck that important queries return good results from an Algolia index.\n\n## Steps\n1. Run each query in the provided test set against the index.\n2. Record the top results, total hit count, and whether the expected record appears.\n3. Flag queries that return zero hits, too many hits, or miss the expected record.\n\n## Output\nA table of queries with result counts and pass/fail, plus suggestions for synonyms or ranking tweaks where relevance is weak.',
},
{
name: 'tune-index-ranking',
description:
'Read an Algolia index configuration, propose ranking and searchable-attribute changes, and apply the update.',
content:
'# Tune Index Ranking\n\nAdjust how an Algolia index ranks results without touching the underlying data.\n\n## Steps\n1. Fetch the current index settings (searchable attributes, custom ranking, ranking criteria).\n2. Compare them against the desired outcome (e.g., surface newer or more popular items first).\n3. Propose specific changes to customRanking, searchableAttributes order, or attributesForFaceting.\n4. Apply the approved settings update to the index.\n\n## Output\nA before/after summary of the settings changed and why, plus confirmation the update succeeded.',
},
{
name: 'snapshot-index-before-change',
description:
'Copy an Algolia index to a timestamped backup before applying a risky settings or data change.',
content:
'# Snapshot Index Before Change\n\nProtect against a bad settings or batch update by copying the index first.\n\n## Steps\n1. Copy the source index to a new destination index named with a date or version suffix.\n2. Confirm the copy completed by checking the resulting task status.\n3. Apply the intended change (settings update, batch operation, or delete-by-filter) to the original index.\n4. If the change causes problems, the snapshot index can be copied back or used for comparison.\n\n## Output\nThe name of the backup index created and confirmation the source change was applied afterward.',
},
],
} as const satisfies BlockMeta
+1 -1
View File
@@ -10,7 +10,7 @@ export const DropcontactBlock: BlockConfig<DropcontactResponse> = {
'Use Dropcontact to verify and enrich B2B contacts. Submit a contact with their name, company, website, or LinkedIn URL and receive a verified professional email, phone number, company firmographics, and LinkedIn profile. Enrichment is async: Dropcontact processes the request, then Sim polls until the result is ready. Credits are only charged when a verified email is returned.',
docsLink: 'https://docs.sim.ai/tools/dropcontact',
category: 'tools',
bgColor: '#0066FF',
bgColor: '#0ABA9F',
icon: DropcontactIcon,
authMode: AuthMode.ApiKey,
integrationType: IntegrationType.Sales,
+1 -1
View File
@@ -13,7 +13,7 @@ export const GrafanaBlock: BlockConfig<GrafanaResponse> = {
docsLink: 'https://docs.sim.ai/integrations/grafana',
category: 'tools',
integrationType: IntegrationType.Observability,
bgColor: '#F46800',
bgColor: '#FFFFFF',
icon: GrafanaIcon,
subBlocks: [
{
+6 -8
View File
@@ -7985,18 +7985,16 @@ export function LeadMagicIcon(props: SVGProps<SVGSVGElement>) {
)
}
/** Dropcontact brand icon: teal disc with the white open-"d" contact mark. */
/** Dropcontact brand icon: the teal swirl mark from the official wordmark. */
export function DropcontactIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg {...props} viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'>
<circle cx='12' cy='12' r='12' fill='#0ABA9F' />
<svg {...props} viewBox='0 0 50 50' fill='none' xmlns='http://www.w3.org/2000/svg'>
<path
d='M13.87 7.9A5 5 0 1 0 13.87 16.1'
stroke='#FFFFFF'
strokeWidth='2.4'
strokeLinecap='round'
fillRule='evenodd'
clipRule='evenodd'
d='M29.57 16.22a10.84 10.84 0 0 0-4.698-1.064c-6.01 0-10.88 4.872-10.88 10.88s4.872 10.88 10.88 10.88c4.09 0 7.655-2.258 9.513-5.596l-2.623-1.457a7.88 7.88 0 0 1-6.89 4.053c-4.353 0-7.88-3.528-7.88-7.88s3.528-7.88 7.88-7.88a7.85 7.85 0 0 1 3.403.77l1.295-2.707zm5.21-14.235v25.762h-3.11V.9C29.546.313 27.3 0 25 0 11.193 0 0 11.193 0 25s11.193 25 25 25 25-11.193 25-25c0-10.337-6.274-19.21-15.222-23.016z'
fill='#0ABA9F'
/>
<path d='M15.1 6.2V17.8' stroke='#FFFFFF' strokeWidth='2.4' strokeLinecap='round' />
</svg>
)
}
+8 -4
View File
@@ -1,5 +1,5 @@
{
"updatedAt": "2026-07-01",
"updatedAt": "2026-07-02",
"integrations": [
{
"type": "onepassword",
@@ -541,9 +541,13 @@
{
"name": "Delete By Filter",
"description": "Delete all records matching a filter from an Algolia index"
},
{
"name": "Get Task Status",
"description": "Check whether an Algolia indexing task has finished publishing"
}
],
"operationCount": 15,
"operationCount": 16,
"triggers": [],
"triggerCount": 0,
"authType": "api-key",
@@ -4418,7 +4422,7 @@
"name": "Dropcontact",
"description": "Enrich B2B contacts with verified email, phone, and company data",
"longDescription": "Use Dropcontact to verify and enrich B2B contacts. Submit a contact with their name, company, website, or LinkedIn URL and receive a verified professional email, phone number, company firmographics, and LinkedIn profile. Enrichment is async: Dropcontact processes the request, then Sim polls until the result is ready. Credits are only charged when a verified email is returned.",
"bgColor": "#0066FF",
"bgColor": "#0ABA9F",
"iconName": "DropcontactIcon",
"docsUrl": "https://docs.sim.ai/tools/dropcontact",
"operations": [
@@ -7312,7 +7316,7 @@
"name": "Grafana",
"description": "Interact with Grafana dashboards, alerts, and annotations",
"longDescription": "Integrate Grafana into workflows. Manage dashboards, alerts, annotations, data sources, folders, and monitor health status.",
"bgColor": "#F46800",
"bgColor": "#FFFFFF",
"iconName": "GrafanaIcon",
"docsUrl": "https://docs.sim.ai/integrations/grafana",
"operations": [
+2 -2
View File
@@ -42,9 +42,9 @@ export const addRecordTool: ToolConfig<AlgoliaAddRecordParams, AlgoliaAddRecordR
request: {
url: (params) => {
const base = `https://${params.applicationId}.algolia.net/1/indexes/${encodeURIComponent(params.indexName)}`
const base = `https://${params.applicationId}.algolia.net/1/indexes/${encodeURIComponent(params.indexName.trim())}`
if (params.objectID) {
return `${base}/${encodeURIComponent(params.objectID)}`
return `${base}/${encodeURIComponent(params.objectID.trim())}`
}
return base
},
+2 -2
View File
@@ -38,13 +38,13 @@ export const batchOperationsTool: ToolConfig<
required: true,
visibility: 'user-or-llm',
description:
'Array of batch operations. Each item has "action" (addObject, updateObject, partialUpdateObject, partialUpdateObjectNoCreate, deleteObject) and "body" (the record data, must include objectID for update/delete)',
'Array of batch operations. Each item has "action" (addObject, updateObject, partialUpdateObject, partialUpdateObjectNoCreate, deleteObject, delete, clear) and "body" (the record data, must include objectID for update/delete; omit body for delete/clear)',
},
},
request: {
url: (params) =>
`https://${params.applicationId}.algolia.net/1/indexes/${encodeURIComponent(params.indexName)}/batch`,
`https://${params.applicationId}.algolia.net/1/indexes/${encodeURIComponent(params.indexName.trim())}/batch`,
method: 'POST',
headers: (params) => ({
'x-algolia-application-id': params.applicationId,
+42 -1
View File
@@ -62,11 +62,36 @@ export const browseRecordsTool: ToolConfig<
visibility: 'user-or-llm',
description: 'Cursor from a previous browse response for pagination',
},
aroundLatLng: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description: 'Coordinates for geo-search (e.g., "40.71,-74.01")',
},
aroundRadius: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description: 'Maximum radius in meters for geo-search, or "all" for unlimited',
},
insideBoundingBox: {
type: 'json',
required: false,
visibility: 'user-or-llm',
description: 'Bounding box coordinates as [[lat1, lng1, lat2, lng2]] for geo-search',
},
insidePolygon: {
type: 'json',
required: false,
visibility: 'user-or-llm',
description:
'Polygon coordinates as [[lat1, lng1, lat2, lng2, lat3, lng3, ...]] for geo-search',
},
},
request: {
url: (params) =>
`https://${params.applicationId}-dsn.algolia.net/1/indexes/${encodeURIComponent(params.indexName)}/browse`,
`https://${params.applicationId}-dsn.algolia.net/1/indexes/${encodeURIComponent(params.indexName.trim())}/browse`,
method: 'POST',
headers: (params) => ({
'x-algolia-application-id': params.applicationId,
@@ -86,6 +111,22 @@ export const browseRecordsTool: ToolConfig<
.map((a: string) => a.trim())
}
if (params.hitsPerPage !== undefined) body.hitsPerPage = Number(params.hitsPerPage)
if (params.aroundLatLng) body.aroundLatLng = params.aroundLatLng
if (params.aroundRadius !== undefined) {
body.aroundRadius = params.aroundRadius === 'all' ? 'all' : Number(params.aroundRadius)
}
if (params.insideBoundingBox) {
body.insideBoundingBox =
typeof params.insideBoundingBox === 'string'
? JSON.parse(params.insideBoundingBox)
: params.insideBoundingBox
}
if (params.insidePolygon) {
body.insidePolygon =
typeof params.insidePolygon === 'string'
? JSON.parse(params.insidePolygon)
: params.insidePolygon
}
return body
},
},
+1 -1
View File
@@ -32,7 +32,7 @@ export const clearRecordsTool: ToolConfig<AlgoliaClearRecordsParams, AlgoliaClea
request: {
url: (params) =>
`https://${params.applicationId}.algolia.net/1/indexes/${encodeURIComponent(params.indexName)}/clear`,
`https://${params.applicationId}.algolia.net/1/indexes/${encodeURIComponent(params.indexName.trim())}/clear`,
method: 'POST',
headers: (params) => ({
'x-algolia-application-id': params.applicationId,
+2 -2
View File
@@ -55,7 +55,7 @@ export const copyMoveIndexTool: ToolConfig<
request: {
url: (params) =>
`https://${params.applicationId}.algolia.net/1/indexes/${encodeURIComponent(params.indexName)}/operation`,
`https://${params.applicationId}.algolia.net/1/indexes/${encodeURIComponent(params.indexName.trim())}/operation`,
method: 'POST',
headers: (params) => ({
'x-algolia-application-id': params.applicationId,
@@ -65,7 +65,7 @@ export const copyMoveIndexTool: ToolConfig<
body: (params) => {
const body: Record<string, unknown> = {
operation: params.operation,
destination: params.destination,
destination: params.destination.trim(),
}
if (params.scope) {
const scope = typeof params.scope === 'string' ? JSON.parse(params.scope) : params.scope
+2 -2
View File
@@ -63,7 +63,7 @@ export const deleteByFilterTool: ToolConfig<
description: 'Coordinates for geo-search filter (e.g., "40.71,-74.01")',
},
aroundRadius: {
type: 'number',
type: 'string',
required: false,
visibility: 'user-or-llm',
description: 'Maximum radius in meters for geo-search, or "all" for unlimited',
@@ -85,7 +85,7 @@ export const deleteByFilterTool: ToolConfig<
request: {
url: (params) =>
`https://${params.applicationId}.algolia.net/1/indexes/${encodeURIComponent(params.indexName)}/deleteByQuery`,
`https://${params.applicationId}.algolia.net/1/indexes/${encodeURIComponent(params.indexName.trim())}/deleteByQuery`,
method: 'POST',
headers: (params) => ({
'x-algolia-application-id': params.applicationId,
+1 -1
View File
@@ -31,7 +31,7 @@ export const deleteIndexTool: ToolConfig<AlgoliaDeleteIndexParams, AlgoliaDelete
request: {
method: 'DELETE',
url: (params) =>
`https://${params.applicationId}.algolia.net/1/indexes/${encodeURIComponent(params.indexName)}`,
`https://${params.applicationId}.algolia.net/1/indexes/${encodeURIComponent(params.indexName.trim())}`,
headers: (params) => ({
'x-algolia-application-id': params.applicationId,
'x-algolia-api-key': params.apiKey,
+1 -1
View File
@@ -38,7 +38,7 @@ export const deleteRecordTool: ToolConfig<AlgoliaDeleteRecordParams, AlgoliaDele
request: {
method: 'DELETE',
url: (params) =>
`https://${params.applicationId}.algolia.net/1/indexes/${encodeURIComponent(params.indexName)}/${encodeURIComponent(params.objectID)}`,
`https://${params.applicationId}.algolia.net/1/indexes/${encodeURIComponent(params.indexName.trim())}/${encodeURIComponent(params.objectID.trim())}`,
headers: (params) => ({
'x-algolia-application-id': params.applicationId,
'x-algolia-api-key': params.apiKey,
+1 -1
View File
@@ -43,7 +43,7 @@ export const getRecordTool: ToolConfig<AlgoliaGetRecordParams, AlgoliaGetRecordR
request: {
method: 'GET',
url: (params) => {
const base = `https://${params.applicationId}-dsn.algolia.net/1/indexes/${encodeURIComponent(params.indexName)}/${encodeURIComponent(params.objectID)}`
const base = `https://${params.applicationId}-dsn.algolia.net/1/indexes/${encodeURIComponent(params.indexName.trim())}/${encodeURIComponent(params.objectID.trim())}`
if (params.attributesToRetrieve) {
return `${base}?attributesToRetrieve=${encodeURIComponent(params.attributesToRetrieve)}`
}
+1 -1
View File
@@ -31,7 +31,7 @@ export const getSettingsTool: ToolConfig<AlgoliaGetSettingsParams, AlgoliaGetSet
request: {
method: 'GET',
url: (params) =>
`https://${params.applicationId}-dsn.algolia.net/1/indexes/${encodeURIComponent(params.indexName)}/settings`,
`https://${params.applicationId}-dsn.algolia.net/1/indexes/${encodeURIComponent(params.indexName.trim())}/settings`,
headers: (params) => ({
'x-algolia-application-id': params.applicationId,
'x-algolia-api-key': params.apiKey,
+75
View File
@@ -0,0 +1,75 @@
import type {
AlgoliaGetTaskStatusParams,
AlgoliaGetTaskStatusResponse,
} from '@/tools/algolia/types'
import type { ToolConfig } from '@/tools/types'
export const getTaskStatusTool: ToolConfig<
AlgoliaGetTaskStatusParams,
AlgoliaGetTaskStatusResponse
> = {
id: 'algolia_get_task_status',
name: 'Algolia Get Task Status',
description: 'Check whether an Algolia indexing task has finished publishing',
version: '1.0',
params: {
applicationId: {
type: 'string',
required: true,
visibility: 'user-only',
description: 'Algolia Application ID',
},
apiKey: {
type: 'string',
required: true,
visibility: 'user-only',
description: 'Algolia API Key',
},
indexName: {
type: 'string',
required: true,
visibility: 'user-or-llm',
description: 'Name of the Algolia index the task ran against',
},
taskID: {
type: 'number',
required: true,
visibility: 'user-or-llm',
description: 'The taskID returned by a previous write operation',
},
},
request: {
method: 'GET',
url: (params) =>
`https://${params.applicationId}.algolia.net/1/indexes/${encodeURIComponent(params.indexName.trim())}/task/${encodeURIComponent(String(params.taskID).trim())}`,
headers: (params) => ({
'x-algolia-application-id': params.applicationId,
'x-algolia-api-key': params.apiKey,
}),
},
transformResponse: async (response) => {
const data = await response.json()
return {
success: true,
output: {
status: data.status ?? '',
pendingTask: data.pendingTask ?? false,
},
}
},
outputs: {
status: {
type: 'string',
description:
'Task status: "published" once the operation has been applied, "notPublished" while still pending',
},
pendingTask: {
type: 'boolean',
description: 'Whether the task is still pending',
},
},
}
+2
View File
@@ -9,6 +9,7 @@ import { deleteRecordTool } from '@/tools/algolia/delete_record'
import { getRecordTool } from '@/tools/algolia/get_record'
import { getRecordsTool } from '@/tools/algolia/get_records'
import { getSettingsTool } from '@/tools/algolia/get_settings'
import { getTaskStatusTool } from '@/tools/algolia/get_task_status'
import { listIndicesTool } from '@/tools/algolia/list_indices'
import { partialUpdateRecordTool } from '@/tools/algolia/partial_update_record'
import { searchTool } from '@/tools/algolia/search'
@@ -24,6 +25,7 @@ export const algoliaBrowseRecordsTool = browseRecordsTool
export const algoliaBatchOperationsTool = batchOperationsTool
export const algoliaListIndicesTool = listIndicesTool
export const algoliaGetSettingsTool = getSettingsTool
export const algoliaGetTaskStatusTool = getTaskStatusTool
export const algoliaUpdateSettingsTool = updateSettingsTool
export const algoliaDeleteIndexTool = deleteIndexTool
export const algoliaCopyMoveIndexTool = copyMoveIndexTool
@@ -55,7 +55,7 @@ export const partialUpdateRecordTool: ToolConfig<
request: {
url: (params) => {
const base = `https://${params.applicationId}.algolia.net/1/indexes/${encodeURIComponent(params.indexName)}/${encodeURIComponent(params.objectID)}/partial`
const base = `https://${params.applicationId}.algolia.net/1/indexes/${encodeURIComponent(params.indexName.trim())}/${encodeURIComponent(params.objectID.trim())}/partial`
if (params.createIfNotExists === false) {
return `${base}?createIfNotExists=false`
}
+58
View File
@@ -56,6 +56,44 @@ export const searchTool: ToolConfig<AlgoliaSearchParams, AlgoliaSearchResponse>
visibility: 'user-or-llm',
description: 'Comma-separated list of attributes to retrieve',
},
facets: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description:
'Comma-separated list of facet attribute names to retrieve counts for (use "*" for all)',
},
getRankingInfo: {
type: 'boolean',
required: false,
visibility: 'user-or-llm',
description: 'Whether to include detailed ranking information in each hit',
},
aroundLatLng: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description: 'Coordinates for geo-search (e.g., "40.71,-74.01")',
},
aroundRadius: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description: 'Maximum radius in meters for geo-search, or "all" for unlimited',
},
insideBoundingBox: {
type: 'json',
required: false,
visibility: 'user-or-llm',
description: 'Bounding box coordinates as [[lat1, lng1, lat2, lng2]] for geo-search',
},
insidePolygon: {
type: 'json',
required: false,
visibility: 'user-or-llm',
description:
'Polygon coordinates as [[lat1, lng1, lat2, lng2, lat3, lng3, ...]] for geo-search',
},
},
request: {
@@ -79,6 +117,26 @@ export const searchTool: ToolConfig<AlgoliaSearchParams, AlgoliaSearchResponse>
.split(',')
.map((a: string) => a.trim())
}
if (params.facets) {
request.facets = params.facets.split(',').map((f: string) => f.trim())
}
if (params.getRankingInfo) request.getRankingInfo = true
if (params.aroundLatLng) request.aroundLatLng = params.aroundLatLng
if (params.aroundRadius !== undefined) {
request.aroundRadius = params.aroundRadius === 'all' ? 'all' : Number(params.aroundRadius)
}
if (params.insideBoundingBox) {
request.insideBoundingBox =
typeof params.insideBoundingBox === 'string'
? JSON.parse(params.insideBoundingBox)
: params.insideBoundingBox
}
if (params.insidePolygon) {
request.insidePolygon =
typeof params.insidePolygon === 'string'
? JSON.parse(params.insidePolygon)
: params.insidePolygon
}
return { requests: [request] }
},
},
+23
View File
@@ -13,6 +13,12 @@ export interface AlgoliaSearchParams extends AlgoliaBaseParams {
page?: number | string
filters?: string
attributesToRetrieve?: string
facets?: string
getRankingInfo?: boolean | string
aroundLatLng?: string
aroundRadius?: number | string
insideBoundingBox?: string | number[][]
insidePolygon?: string | number[][]
}
export interface AlgoliaSearchResponse extends ToolResponse {
@@ -116,6 +122,10 @@ export interface AlgoliaBrowseRecordsParams extends AlgoliaBaseParams {
attributesToRetrieve?: string
hitsPerPage?: number | string
cursor?: string
aroundLatLng?: string
aroundRadius?: number | string
insideBoundingBox?: string | number[][]
insidePolygon?: string | number[][]
}
export interface AlgoliaBrowseRecordsResponse extends ToolResponse {
@@ -266,3 +276,16 @@ export interface AlgoliaDeleteByFilterResponse extends ToolResponse {
updatedAt: string | null
}
}
// Get Task Status
export interface AlgoliaGetTaskStatusParams extends AlgoliaBaseParams {
indexName: string
taskID: number | string
}
export interface AlgoliaGetTaskStatusResponse extends ToolResponse {
output: {
status: string
pendingTask: boolean
}
}
+1 -1
View File
@@ -49,7 +49,7 @@ export const updateSettingsTool: ToolConfig<
request: {
url: (params) => {
const base = `https://${params.applicationId}.algolia.net/1/indexes/${encodeURIComponent(params.indexName)}/settings`
const base = `https://${params.applicationId}.algolia.net/1/indexes/${encodeURIComponent(params.indexName.trim())}/settings`
if (params.forwardToReplicas) {
return `${base}?forwardToReplicas=true`
}
+2
View File
@@ -101,6 +101,7 @@ import {
algoliaGetRecordsTool,
algoliaGetRecordTool,
algoliaGetSettingsTool,
algoliaGetTaskStatusTool,
algoliaListIndicesTool,
algoliaPartialUpdateRecordTool,
algoliaSearchTool,
@@ -6643,6 +6644,7 @@ export const tools: Record<string, ToolConfig> = {
algolia_copy_move_index: algoliaCopyMoveIndexTool,
algolia_clear_records: algoliaClearRecordsTool,
algolia_delete_by_filter: algoliaDeleteByFilterTool,
algolia_get_task_status: algoliaGetTaskStatusTool,
airtable_create_records: airtableCreateRecordsTool,
airtable_delete_records: airtableDeleteRecordsTool,
airtable_get_base_schema: airtableGetBaseSchemaTool,