Karthik | Langtrace AI
08/07/2025, 11:57 PMtoolset.getTools() results are not compatible. I had to write a middleware to transform the results to make it compatible
const wrapComposioTools = (tools: ToolSet): ToolSet => {
const wrapped: ToolSet = {};
for (const [name, t] of Object.entries<any>(tools)) {
const hasComposioJsonSchema = t?.parameters?.jsonSchema;
if (hasComposioJsonSchema) {
const description = t?.description ?? name;
const schemaObject = t.parameters.jsonSchema ?? {
type: "object",
properties: {},
};
const execute =
typeof t?.execute === "function"
? t.execute.bind(t)
: async () => ({ success: false, error: "No execute provided" });
wrapped[name] = tool({
description,
inputSchema: jsonSchema(schemaObject),
execute: async (args: any) => execute(args),
});
} else {
wrapped[name] = t as any;
}
}
return wrapped;
};Composio Support Agent
08/08/2025, 12:01 PMComposio Support Agent
08/08/2025, 12:18 PMgsathya
08/08/2025, 3:34 PMgsathya
08/08/2025, 3:35 PMKarthik | Langtrace AI
08/08/2025, 11:53 PMconst linearTools = await toolset.getTools({
apps: ["linear"],
actions: [
"LINEAR_GET_LINEAR_ISSUE",
"LINEAR_CREATE_LINEAR_ATTACHMENT",
"LINEAR_CREATE_LINEAR_ISSUE",
"LINEAR_CREATE_LINEAR_COMMENT",
"LINEAR_CREATE_LINEAR_ISSUE_DETAILS",
"LINEAR_LIST_LINEAR_ISSUES",
"LINEAR_LIST_LINEAR_PROJECTS",
"LINEAR_LIST_LINEAR_STATES",
"LINEAR_LIST_LINEAR_TEAMS",
"LINEAR_RUN_QUERY_OR_MUTATION",
],
});
const wrappedLinearTools = wrapComposioTools(linearTools)
# aisdk
await generateText(
...
tools: wrappedLinearTools,
...
)Karthik | Langtrace AI
08/11/2025, 7:26 PMachraf6562
08/11/2025, 8:45 PMachraf6562
08/14/2025, 1:43 PM