@mcp-z/server
    Preparing search index...

    Function reserveFile

    • Reserve a file location for streaming writes

      Generates a validated ID and returns all paths needed to write the file. Does NOT create the file - caller should write to fullPath using streams or other means.

      Parameters

      • originalFilename: string

        Original filename to preserve

      • config: FileServingConfig

        File serving configuration

      Returns Promise<FileReservation>

      FileReservation with id, storedName, and fullPath

      const reservation = await reserveFile('export.csv', {
      resourceStoreUri: 'file:///tmp/files',
      delimiter: '-'
      });

      const stream = createWriteStream(reservation.fullPath);
      // ... write CSV incrementally ...
      stream.end();

      const uri = getFileUri(reservation.storedName, transport, uriConfig);