Skip to main content

Tool Types

interface ToolConfig<TInput = any, TOutput = any> {
  id: string;
  description: string;
  inputSchema: z.ZodSchema<TInput>;
  outputSchema?: z.ZodSchema<TOutput>;
  execute: (params: {
    context: TInput;
    runflow: RunflowAPIClient;
    projectId: string;
  }) => Promise<TOutput>;
}

interface RunflowTool {
  id: string;
  name?: string;
  description: string;
  parameters: Record<string, ToolParameter>;
  execute: (params: any, context: ToolContext) => Promise<any>;
}

interface ToolContext {
  projectId: string;
  companyId: string;
  userId?: string;
  sessionId?: string;
  runflowAPI: RunflowAPIClient;
}

Next Steps