UNPKG

@mondaydotcomorg/atp-client

Version:
31 lines 1.21 kB
import { z } from 'zod'; import { zodToJsonSchema } from 'zod-to-json-schema'; import { ToolNames } from './types.js'; const fetchAllApisInputSchema = z.object({ apiGroups: z.array(z.string()).optional().describe('Optional: Specific API groups to include'), }); export function createFetchAllApisTool(client) { return { name: ToolNames.FETCH_ALL_APIS, description: 'Get TypeScript definitions of all available APIs. Returns code showing api.add, api.getTodo, etc.', inputSchema: zodToJsonSchema(fetchAllApisInputSchema), zodSchema: fetchAllApisInputSchema, func: async (_input) => { try { const typescript = client.getTypeDefinitions(); return JSON.stringify({ success: true, typescript, message: 'Use this TypeScript to understand available api.* functions', }, null, 2); } catch (error) { return JSON.stringify({ success: false, error: error.message, }, null, 2); } }, }; } //# sourceMappingURL=fetch-all-apis.js.map