@devries-cameron20 / composio Mirror · read-only
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 04:45 UTC

next
ts 17 lines 667 Bytes
Raw
1 import { Composio, jsonSchemaToZodSchema } from '@composio/core';
2 import zodToJsonSchema from 'zod-to-json-schema';
3
4 const composio = new Composio({
5 apiKey: process.env.COMPOSIO_API_KEY,
6 });
7
8 const tool = await composio.tools.getRawComposioToolBySlug(
9 'GOOGLESHEETS_SPREADSHEETS_VALUES_APPEND'
10 );
11 const inputParams = tool.inputParameters;
12 console.log(`---------- Original Input Parameters ----------`);
13 console.log(JSON.stringify(inputParams, null, 2));
14
15 const zodSchema = jsonSchemaToZodSchema(inputParams ?? {});
16 console.log(`---------- Zod Schema Parsed ----------`);
17 console.log(JSON.stringify(zodToJsonSchema(zodSchema, { target: "jsonSchema7"}), null, 2));