Skip to content

Commit 86139d1

Browse files
committed
fix(superagent): fix superagent tools and checkpoints
1 parent 301b07c commit 86139d1

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

apps/sim/lib/copilot/chat/payload.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ export interface ToolSchema {
5252
params?: Record<string, unknown>
5353
/** Canonical integration service/folder (e.g. "slack"), for server-side grouping. */
5454
service?: string
55+
/**
56+
* Operation stem within the service — the VFS doc filename without `.json`
57+
* (e.g. "list_users" for id "slack_list_users"). Stamped so the server can
58+
* hand agents the exact `components/integrations/{service}/{operation}.json`
59+
* path instead of making them derive it from the id (deriving is how the id
60+
* gets guessed as the filename).
61+
*/
62+
operation?: string
5563
oauth?: { required: boolean; provider: string }
5664
}
5765

@@ -184,7 +192,7 @@ async function buildIntegrationToolSchemasUncached(
184192
}
185193
}
186194

187-
for (const { toolId, config: toolConfig, service } of getExposedIntegrationTools()) {
195+
for (const { toolId, config: toolConfig, service, operation } of getExposedIntegrationTools()) {
188196
try {
189197
if (allowedIntegrations && toolIdToBlockType) {
190198
const owningBlock = toolIdToBlockType.get(stripVersionSuffix(toolId))
@@ -199,6 +207,7 @@ async function buildIntegrationToolSchemasUncached(
199207
integrationTools.push({
200208
name: toolId,
201209
service,
210+
operation,
202211
description: getCopilotToolDescription(toolConfig, {
203212
isHosted,
204213
fallbackName: toolId,

apps/sim/lib/copilot/tools/handlers/integration-tools.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ export async function executeListIntegrationTools(
2727
success: true,
2828
output: {
2929
integration: service,
30-
note: 'Call load_integration_tool({tool_ids: ["<id>"]}) with the exact id before invoking an operation.',
30+
note: 'Read the entry\'s "path" verbatim for exact params, then load_integration_tool({tool_ids: ["<id>"]}) and call the tool by that exact id.',
3131
tools: matches.map((tool) => ({
3232
id: tool.toolId,
3333
operation: tool.operation,
34+
path: `components/integrations/${tool.service}/${tool.operation}.json`,
3435
name: tool.config.name,
3536
description: tool.config.description,
3637
})),

0 commit comments

Comments
 (0)