Skip to content

Commit e626ef0

Browse files
committed
Add char limit for custom tools
1 parent 14638eb commit e626ef0

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/openapi.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,20 @@ export async function loadCustomOpenApiTools(
122122
: []),
123123
];
124124

125-
const toolName = `${item.integrationName
125+
let integrationSlug = item.integrationName
126126
.split(".")
127127
.join("_")
128-
.toUpperCase()}_${requestName.split(" ").join("_").toUpperCase().trimEnd()}`;
128+
.toUpperCase();
129+
130+
if (integrationSlug.startsWith("CUSTOM_")) {
131+
integrationSlug = integrationSlug.slice("CUSTOM_".length);
132+
}
133+
134+
const toolName = `${integrationSlug}_${requestName
135+
.split(" ")
136+
.join("_")
137+
.toUpperCase()
138+
.trimEnd()}`.slice(0, 50);
129139

130140
openApiRequests[toolName] = {
131141
baseUrl: spec.servers?.[0]?.url,

src/tools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export function registerTools({
170170
throw new Error("User ID not found");
171171
}
172172
setupUrl = await generateSetupLink({
173-
...error.jsonResponse.meta,
173+
projectId: envs.PROJECT_ID,
174174
integrationName:
175175
tool.name === "CALL_API_REQUEST"
176176
? (args as ProxyApiRequestToolArgs).integration

0 commit comments

Comments
 (0)