Skip to content

Commit 7d0c4a9

Browse files
committed
fix(superagent): fix superagent tools and checkpoints
1 parent 73a07b9 commit 7d0c4a9

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
@@ -57,6 +57,14 @@ export interface ToolSchema {
5757
params?: Record<string, unknown>
5858
/** Canonical integration service/folder (e.g. "slack"), for server-side grouping. */
5959
service?: string
60+
/**
61+
* Operation stem within the service — the VFS doc filename without `.json`
62+
* (e.g. "list_users" for id "slack_list_users"). Stamped so the server can
63+
* hand agents the exact `components/integrations/{service}/{operation}.json`
64+
* path instead of making them derive it from the id (deriving is how the id
65+
* gets guessed as the filename).
66+
*/
67+
operation?: string
6068
oauth?: { required: boolean; provider: string }
6169
}
6270

@@ -201,7 +209,7 @@ async function buildIntegrationToolSchemasUncached(
201209
}
202210

203211
const exposedTools = filterExposedIntegrationTools(getExposedIntegrationTools(), vis)
204-
for (const { toolId, config: toolConfig, service } of exposedTools) {
212+
for (const { toolId, config: toolConfig, service, operation } of exposedTools) {
205213
try {
206214
if (allowedIntegrations && toolIdToBlockType) {
207215
const owningBlock = toolIdToBlockType.get(stripVersionSuffix(toolId))
@@ -216,6 +224,7 @@ async function buildIntegrationToolSchemasUncached(
216224
integrationTools.push({
217225
name: toolId,
218226
service,
227+
operation,
219228
description: getCopilotToolDescription(toolConfig, {
220229
isHosted,
221230
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
@@ -34,10 +34,11 @@ export async function executeListIntegrationTools(
3434
success: true,
3535
output: {
3636
integration: service,
37-
note: 'Call load_integration_tool({tool_ids: ["<id>"]}) with the exact id before invoking an operation.',
37+
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.',
3838
tools: matches.map((tool) => ({
3939
id: tool.toolId,
4040
operation: tool.operation,
41+
path: `components/integrations/${tool.service}/${tool.operation}.json`,
4142
name: tool.config.name,
4243
description: tool.config.description,
4344
})),

0 commit comments

Comments
 (0)